public class TiedMapEntry<K,V> extends Object implements Map.Entry<K,V>, KeyValue<K,V>, Serializable
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 and Description |
|---|
TiedMapEntry(Map<K,V> map,
K key)
Constructs a new entry with the given Map and key.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public TiedMapEntry(Map<K,V> map, K key)
map - the mapkey - the keypublic V setValue(V value)
setValue in interface Map.Entry<K,V>value - the new valueIllegalArgumentException - if the value is set to this map entrypublic boolean equals(Object obj)
Map.Entry with another Map.Entry.
Implemented per API documentation of Map.Entry.equals(Object)
public int hashCode()
Implemented per API documentation of Map.Entry.hashCode()
Copyright © 2001–2013 The Apache Software Foundation. All rights reserved.