aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/util/AbstractMap.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-11-10 22:06:49 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-11-10 22:06:49 +0000
commitf18590c6209457736eda5e66c76c33e3f92532fd (patch)
treeb99c34071ce1e42a9742123fef03b7f802acd754 /libjava/java/util/AbstractMap.java
parent99c49d11c10224de2364fc1d56039f8ff5899d0f (diff)
downloadgcc-f18590c6209457736eda5e66c76c33e3f92532fd.zip
gcc-f18590c6209457736eda5e66c76c33e3f92532fd.tar.gz
gcc-f18590c6209457736eda5e66c76c33e3f92532fd.tar.bz2
Externalizable.java, [...]: New versions from Classpath.
* java/io/Externalizable.java, java/io/FilePermission.java, java/io/ObjectStreamConstants.java, java/io/Serializable.java, java/io/SerializablePermission.java, java/text/Format.java, java/util/AbstractMap.java, java/util/HashMap.java, java/util/LinkedHashMap.java, javax/naming/BinaryRefAddr.java: New versions from Classpath. From-SVN: r58996
Diffstat (limited to 'libjava/java/util/AbstractMap.java')
-rw-r--r--libjava/java/util/AbstractMap.java29
1 files changed, 16 insertions, 13 deletions
diff --git a/libjava/java/util/AbstractMap.java b/libjava/java/util/AbstractMap.java
index 11c8f5b..4be5f3d 100644
--- a/libjava/java/util/AbstractMap.java
+++ b/libjava/java/util/AbstractMap.java
@@ -466,6 +466,11 @@ public abstract class AbstractMap implements Map
return AbstractMap.this.size();
}
+ public boolean contains(Object value)
+ {
+ return containsValue(value);
+ }
+
public Iterator iterator()
{
return new Iterator()
@@ -527,8 +532,9 @@ public abstract class AbstractMap implements Map
* @author Jon Zeppieri
* @author Eric Blake <ebb9@email.byu.edu>
*/
+ // XXX - FIXME Use fully qualified implements as gcj 3.1 workaround.
static class BasicMapEntry implements Map.Entry
- { // XXX - FIXME Use fully qualified implements as gcj 3.1 workaround.
+ {
/**
* The key. Package visible for direct manipulation.
*/
@@ -553,16 +559,14 @@ public abstract class AbstractMap implements Map
/**
* Compares the specified object with this entry. Returns true only if
* the object is a mapping of identical key and value. In other words,
- * this must be:
- *
-<pre>(o instanceof Map.Entry) &&
-(getKey() == null ? ((HashMap) o).getKey() == null
- : getKey().equals(((HashMap) o).getKey())) &&
-(getValue() == null ? ((HashMap) o).getValue() == null
- : getValue().equals(((HashMap) o).getValue()))</pre>
+ * this must be:<br>
+ * <pre>(o instanceof Map.Entry)
+ * && (getKey() == null ? ((HashMap) o).getKey() == null
+ * : getKey().equals(((HashMap) o).getKey()))
+ * && (getValue() == null ? ((HashMap) o).getValue() == null
+ * : getValue().equals(((HashMap) o).getValue()))</pre>
*
* @param o the object to compare
- *
* @return <code>true</code> if it is equal
*/
public final boolean equals(Object o)
@@ -605,10 +609,9 @@ public abstract class AbstractMap implements Map
/**
* Returns the hash code of the entry. This is defined as the exclusive-or
* of the hashcodes of the key and value (using 0 for null). In other
- * words, this must be:
- *
-<pre>(getKey() == null ? 0 : getKey().hashCode())
-^ (getValue() == null ? 0 : getValue().hashCode())</pre>
+ * words, this must be:<br>
+ * <pre>(getKey() == null ? 0 : getKey().hashCode())
+ * ^ (getValue() == null ? 0 : getValue().hashCode())</pre>
*
* @return the hash code
*/