net.cscott.jutil
public class PairMapEntry<K,V> extends AbstractMapEntry<K,V>
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.
Version: $Id: PairMapEntry.java,v 1.1 2003/03/20 01:58:20 cananian Exp $
Constructor Summary | |
---|---|
PairMapEntry(K key, V value) Creates a PairMapEntry . |
Method Summary | |
---|---|
K | getKey() |
V | getValue() |
protected K | setKey(K newKey) For use in subclass implementations *only*. |
V | setValue(V newValue) |
PairMapEntry
.