From f18590c6209457736eda5e66c76c33e3f92532fd Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 10 Nov 2002 22:06:49 +0000 Subject: 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 --- libjava/java/util/AbstractMap.java | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'libjava/java/util/AbstractMap.java') diff --git a/libjava/java/util/AbstractMap.java b/libjava/java/util/AbstractMap.java index 11c8f5b544c..4be5f3dbd94 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 */ + // 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: - * -
(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()))
+ * this must be:
+ *
(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()))
* * @param o the object to compare - * * @return true 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: - * -
(getKey() == null ? 0 : getKey().hashCode())
-^ (getValue() == null ? 0 : getValue().hashCode())
+ * words, this must be:
+ *
(getKey() == null ? 0 : getKey().hashCode())
+     *       ^ (getValue() == null ? 0 : getValue().hashCode())
* * @return the hash code */ -- cgit v1.2.3