Package net.cscott.jutil
Class PairMapEntry<K,V>
java.lang.Object
net.cscott.jutil.AbstractMapEntry<K,V>
net.cscott.jutil.PairMapEntry<K,V>
- All Implemented Interfaces:
Map.Entry<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 PairMapEntrys 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
nulls in their internal structures.- Author:
- Felix S. Klock II <pnkfelix@mit.edu>
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class net.cscott.jutil.AbstractMapEntry
equals, hashCode, toString
-
Constructor Details
-
PairMapEntry
Creates aPairMapEntry.
-
-
Method Details
-
getKey
Description copied from class:AbstractMapEntryReturns the key corresponding to this entry. -
getValue
Description copied from class:AbstractMapEntryReturns the value corresponding to this entry. If the mapping has been removed from the backing map (by the iterator'sremove()operation), the results of this call are undefined. -
setKey
For use in subclass implementations *only*. -
setValue
Description copied from class:AbstractMapEntryReplaces the value corresponding to this entry with the specified value (optional operation). (Writes through to the map.) The behavior of this call is undefined if the mapping has already been removed from the map (by the iterator'sremove()operation).
-