|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrailo.commons.util.mod.AbstractMapPro.SimpleEntry<K,V>
public static class AbstractMapPro.SimpleEntry<K,V>
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 | |
---|---|
AbstractMapPro.SimpleEntry(K key,
V value)
Creates an entry representing a mapping from the specified key to the specified value. |
|
AbstractMapPro.SimpleEntry(Map.Entry<? extends K,? extends V> entry)
Creates an entry representing the same mapping as the specified entry. |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
K |
getKey()
Returns the key corresponding to this entry. |
V |
getValue()
Returns the value corresponding to this entry. |
int |
hashCode()
|
V |
setValue(V value)
Replaces the value corresponding to this entry with the specified value. |
String |
toString()
Returns a String representation of this map entry. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractMapPro.SimpleEntry(K key, V value)
key
- the key represented by this entryvalue
- the value represented by this entrypublic AbstractMapPro.SimpleEntry(Map.Entry<? extends K,? extends V> entry)
entry
- the entry to copyMethod Detail |
---|
public K getKey()
getKey
in interface Map.Entry<K,V>
public V getValue()
getValue
in interface Map.Entry<K,V>
public V setValue(V value)
setValue
in interface Map.Entry<K,V>
value
- new value to be stored in this entry
public boolean equals(Object o)
equals
in interface Map.Entry<K,V>
equals
in class Object
public int hashCode()
hashCode
in interface Map.Entry<K,V>
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |