public static interface Map.Entry<K,V>
Map,
Map.entrySet()| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Compares the specified object with this entry.
|
K |
getKey()
Get the key corresponding to this entry.
|
V |
getValue()
Get the value corresponding to this entry.
|
int |
hashCode()
Returns the hash code of the entry.
|
V |
setValue(V value)
Replaces the value with the specified object (optional operation).
|
boolean equals(Object o)
(o instanceof Map.Entry)
&& (getKey() == null ? ((Map.Entry) o).getKey() == null
: getKey().equals(((Map.Entry) o).getKey()))
&& (getValue() == null ? ((Map.Entry) o).getValue() == null
: getValue().equals(((Map.Entry) o).getValue()))K getKey()
V getValue()
int hashCode()
null). In other words, this must be:
(getKey() == null ? 0 : getKey().hashCode()) ^ (getValue() == null ? 0 : getValue().hashCode())
V setValue(V value)
value - the new value to storeUnsupportedOperationException - if the operation is not supportedClassCastException - if the value is of the wrong typeIllegalArgumentException - if something about the value
prevents it from existing in this mapNullPointerException - if the map forbids null values