diff options
author | Eric Blake <ebb9@byu.net> | 2002-11-06 14:03:43 +0000 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2002-11-06 14:03:43 +0000 |
commit | 0aaa1ba2a924f0775f2edcec185a1f11a5dd1b2e (patch) | |
tree | a42869f51a67e0c7a1a0f8a7d15fbd292679c7a1 /java/util/AbstractMap.java | |
parent | 6f46e9ae90b23499c818038292d5fa9d2867f3f0 (diff) | |
download | classpath-0aaa1ba2a924f0775f2edcec185a1f11a5dd1b2e.tar.gz |
2002-11-06 Eric Blake <ebb9@email.byu.edu>
* java/util/AbstractMap.java (values().contains): Add missing
method.
* java/util/HashMap.java (HashEntry.access): New method.
(put): Call it.
(getEntry): Optimize.
(readObject): Fix deserialization of LinkedHashMap.
* java/util/LinkedHashMap.java (head): replace root and tail for
more efficient and more compliant implementation.
(LinkedHashEntry.access): Implement.
Diffstat (limited to 'java/util/AbstractMap.java')
-rw-r--r-- | java/util/AbstractMap.java | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/java/util/AbstractMap.java b/java/util/AbstractMap.java index 11c8f5b54..4be5f3dbd 100644 --- a/java/util/AbstractMap.java +++ b/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 */ |