org.planx.util
Class BijectiveMap<K,V>

java.lang.Object
  extended by org.planx.util.BijectiveMap<K,V>

public class BijectiveMap<K,V>
extends Object

A translation which is one-to-one and onto.

Author:
Thomas Ambus

Constructor Summary
BijectiveMap()
           
 
Method Summary
 void clear()
           
 void clearModified()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 V get(Object key)
           
 K getKey(Object value)
           
static
<E,F> SizeStreamer<BijectiveMap<E,F>>
getStreamer(SizeStreamer<E> keyStreamer, SizeStreamer<F> valueStreamer)
          Returns a streamer capable of writing and reading a BijectiveMap.
 boolean isModified()
           
 V put(K key, V value)
           
 V remove(Object key)
           
 K removeValue(Object value)
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BijectiveMap

public BijectiveMap()
Method Detail

put

public V put(K key,
             V value)

containsKey

public boolean containsKey(Object key)

containsValue

public boolean containsValue(Object value)

get

public V get(Object key)

getKey

public K getKey(Object value)

remove

public V remove(Object key)

removeValue

public K removeValue(Object value)

clear

public void clear()

isModified

public boolean isModified()

clearModified

public void clearModified()

size

public int size()

toString

public String toString()
Overrides:
toString in class Object

getStreamer

public static <E,F> SizeStreamer<BijectiveMap<E,F>> getStreamer(SizeStreamer<E> keyStreamer,
                                                                SizeStreamer<F> valueStreamer)
Returns a streamer capable of writing and reading a BijectiveMap. The toStream method always returns null.



Copyright © 2004-2005 Plan-X. All Rights Reserved.