|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.emory.mathcs.backport.java.util.AbstractMap.SimpleEntry
An Entry maintaining a key and a value. The value may be changed using the setValue method. This class facilitates the process of building custom map implementations. For example, it may be convenient to return arrays of SimpleEntry instances in method Map.entrySet().toArray
| Constructor Summary | |
AbstractMap.SimpleEntry(java.util.Map.Entry entry)
Creates an entry representing the same mapping as the specified entry. |
|
AbstractMap.SimpleEntry(java.lang.Object key,
java.lang.Object value)
Creates an entry representing a mapping from the specified key to the specified value. |
|
| Method Summary | |
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
getKey()
Returns the key corresponding to this entry. |
java.lang.Object |
getValue()
Returns the value corresponding to this entry. |
int |
hashCode()
|
java.lang.Object |
setValue(java.lang.Object value)
Replaces the value corresponding to this entry with the specified value. |
java.lang.String |
toString()
Returns a String representation of this map entry. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public AbstractMap.SimpleEntry(java.lang.Object key,
java.lang.Object value)
key - the key represented by this entryvalue - the value represented by this entrypublic AbstractMap.SimpleEntry(java.util.Map.Entry entry)
entry - the entry to copy| Method Detail |
public java.lang.Object getKey()
getKey in interface java.util.Map.Entrypublic java.lang.Object getValue()
getValue in interface java.util.Map.Entrypublic java.lang.Object setValue(java.lang.Object value)
setValue in interface java.util.Map.Entryvalue - new value to be stored in this entry
public boolean equals(java.lang.Object o)
equals in interface java.util.Map.Entrypublic int hashCode()
hashCode in interface java.util.Map.Entrypublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||