|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.keyvalue.TiedMapEntry<K,V>
public class TiedMapEntry<K,V>
A Map Entry tied to a map underneath.
This can be used to enable a map entry to make changes on the underlying map, however this will probably mess up any iterators.
Constructor Summary | |
---|---|
TiedMapEntry(Map<K,V> map,
K key)
Constructs a new entry with the given Map and key. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Compares this Map Entry with another Map Entry. |
K |
getKey()
Gets the key of this entry |
V |
getValue()
Gets the value of this entry direct from the map. |
int |
hashCode()
Gets a hashCode compatible with the equals method. |
V |
setValue(V value)
Sets the value associated with the key direct onto the map. |
String |
toString()
Gets a string version of the entry. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TiedMapEntry(Map<K,V> map, K key)
map
- the mapkey
- the keyMethod Detail |
---|
public K getKey()
getKey
in interface Map.Entry<K,V>
getKey
in interface KeyValue<K,V>
public V getValue()
getValue
in interface Map.Entry<K,V>
getValue
in interface KeyValue<K,V>
public V setValue(V value)
setValue
in interface Map.Entry<K,V>
value
- the new value
IllegalArgumentException
- if the value is set to this map entrypublic boolean equals(Object obj)
Map.Entry.equals(Object)
equals
in interface Map.Entry<K,V>
equals
in class Object
obj
- the object to compare to
public int hashCode()
Map.Entry.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 |