|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Util.Collections.AbstractMapEntry | +--harpoon.Util.Collections.PairMapEntry
PairMapEntry
is the easiest implementation of a
Map.Entry
ever: a pair! Basically saves coders the
drugery of writing an inner class at the expense of an import
statement.
Note that PairMapEntry
s are mutable:
setValue(Object)
is defined in this class.
Using null
as a key or value will not cause this class
or AbstractMapEntry
to fail, but be warned that
several Map
implementations do not like
null
s in their internal structures.
Constructor Summary | |
PairMapEntry(Object key,
Object value)
Creates a PairMapEntry . |
Method Summary | |
Object |
getKey()
Returns the key corresponding to this entry. |
Object |
getValue()
Returns the value corresponding to this entry. |
protected Object |
setKey(Object newKey)
For use in subclass implementations *only*. |
Object |
setValue(Object newValue)
Replaces the value corresponding to this entry with the specified value (optional operation). |
Methods inherited from class harpoon.Util.Collections.AbstractMapEntry |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PairMapEntry(Object key, Object value)
PairMapEntry
.
Method Detail |
public Object getKey()
AbstractMapEntry
getKey
in interface Map.Entry
getKey
in class AbstractMapEntry
public Object getValue()
AbstractMapEntry
remove()
operation), the results of this call are
undefined.
getValue
in interface Map.Entry
getValue
in class AbstractMapEntry
protected Object setKey(Object newKey)
public Object setValue(Object newValue)
AbstractMapEntry
remove()
operation).
setValue
in interface Map.Entry
setValue
in class AbstractMapEntry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |