net.cscott.jutil

Class PairMapEntry<K,V>

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 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.

Version: $Id: PairMapEntry.java,v 1.1 2003/03/20 01:58:20 cananian Exp $

Author: Felix S. Klock II

Constructor Summary
PairMapEntry(K key, V value)
Creates a PairMapEntry.
Method Summary
KgetKey()
VgetValue()
protected KsetKey(K newKey)
For use in subclass implementations *only*.
VsetValue(V newValue)

Constructor Detail

PairMapEntry

public PairMapEntry(K key, V value)
Creates a PairMapEntry.

Method Detail

getKey

public K getKey()

getValue

public V getValue()

setKey

protected K setKey(K newKey)
For use in subclass implementations *only*.

setValue

public V setValue(V newValue)
Copyright © 2003 C. Scott Ananian