net.cscott.jutil

Class PairMapEntry<K,V>

public class PairMapEntry<K,V> extends AbstractMapEntry<K,V>

PairMapEntry is the easiest implementation of a java.util.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: PairMapEntry 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 java.util.Map implementations do not like nulls in their internal structures.

Version: $Id: PairMapEntry.java,v 1.3 2006-10-30 20:14:41 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 (c) 2006 C. Scott Ananian