public abstract class AbstractMapEntry<K,V>
extends java.lang.Object
implements java.util.Map.Entry<K,V>
AbstractMapEntry takes care of most of the grunge
work involved in subclassing Map.Entry. For
an immutable entry, you need only implement getKey()
and getValue(). For a modifiable entry, you must also
implement setValue(Object); the default implementation throws
an UnsupportedOperationException.| Constructor and Description |
|---|
AbstractMapEntry() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Compares the specified object with this entry for equality.
|
abstract K |
getKey()
Returns the key corresponding to this entry.
|
abstract V |
getValue()
Returns the value corresponding to this entry.
|
int |
hashCode()
Returns the hash code value for this map entry.
|
V |
setValue(V value)
Replaces the value corresponding to this entry with the specified
value (optional operation).
|
java.lang.String |
toString()
Returns a human-readable representation of this map entry.
|
public abstract K getKey()
public abstract V getValue()
remove() operation), the results of this call are
undefined.public V setValue(V value)
remove()
operation).public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
true if the given object is also a map
entry and the two entries represent the same mapping.Copyright (c) 2006 C. Scott Ananian