|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public static interface Map.Entry
A map entry (key-value pair). The Map.entrySet() method returns a set view of these objects; there is no other valid way to come across them. These objects are only valid for the duration of an iteration; in other words, if you mess with one after modifying the map, you are asking for undefined behavior.
Map,
Map.entrySet()| Method Summary | |
|---|---|
boolean |
equals(Object o)
Compares the specified object with this entry. |
Object |
getKey()
Get the key corresponding to this entry. |
Object |
getValue()
Get the value corresponding to this entry. |
int |
hashCode()
Returns the hash code of the entry. |
Object |
setValue(Object value)
Replaces the value with the specified object (optional operation). |
| Method Detail |
|---|
Object getKey()
Object getValue()
Object setValue(Object value)
value - the new value to store
UnsupportedOperationException - if the operation is not supported
ClassCastException - if the value is of the wrong type
IllegalArgumentException - if something about the value
prevents it from existing in this map
NullPointerException - if the map forbids null valuesint hashCode()
null). In other words, this must be:
(getKey() == null ? 0 : getKey().hashCode()) ^ (getValue() == null ? 0 : getValue().hashCode())
hashCode in class ObjectObject.equals(Object),
System.identityHashCode(Object)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()))
equals in class Objecto - the object to compare
true if it is equalObject.hashCode()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||