Class TiedMapEntry
java.lang.Object
org.apache.commons.collections.keyvalue.TiedMapEntry
- All Implemented Interfaces:
Serializable
,Map.Entry
,KeyValue
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.
- Since:
- Commons Collections 3.0
- Version:
- $Revision: 646777 $ $Date: 2008-04-10 14:33:15 +0200 (Thu, 10 Apr 2008) $
- Author:
- Stephen Colebourne
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTiedMapEntry
(Map map, Object key) Constructs a new entry with the given Map and key. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares thisMap.Entry
with anotherMap.Entry
.getKey()
Gets the key of this entrygetValue()
Gets the value of this entry direct from the map.int
hashCode()
Gets a hashCode compatible with the equals method.Sets the value associated with the key direct onto the map.toString()
Gets a string version of the entry.
-
Constructor Details
-
TiedMapEntry
Constructs a new entry with the given Map and key.- Parameters:
map
- the mapkey
- the key
-
-
Method Details
-
getKey
Gets the key of this entry -
getValue
Gets the value of this entry direct from the map. -
setValue
Sets the value associated with the key direct onto the map.- Specified by:
setValue
in interfaceMap.Entry
- Parameters:
value
- the new value- Returns:
- the old value
- Throws:
IllegalArgumentException
- if the value is set to this map entry
-
equals
Compares thisMap.Entry
with anotherMap.Entry
.Implemented per API documentation of
Map.Entry.equals(Object)
-
hashCode
public int hashCode()Gets a hashCode compatible with the equals method.Implemented per API documentation of
Map.Entry.hashCode()
-
toString
Gets a string version of the entry.
-