org.ho.util
Class BiDirectionalMap<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by org.ho.util.BiDirectionalMap<K,V>
Type Parameters:
K - the type of the keys
V - the type of the values
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<K,V>

public class BiDirectionalMap<K,V>
extends java.util.HashMap<K,V>

BiDirectionalMap provides a getReverse() method in addition to the HashMap to get a reverse mapping.

See Also:
Serialized Form

Constructor Summary
BiDirectionalMap()
           
 
Method Summary
 java.util.Map<V,K> getReverse()
           
 V put(K key, V value)
           
 V remove(java.lang.Object key)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

BiDirectionalMap

public BiDirectionalMap()
Method Detail

put

public V put(K key,
             V value)
Specified by:
put in interface java.util.Map<K,V>
Overrides:
put in class java.util.HashMap<K,V>

remove

public V remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map<K,V>
Overrides:
remove in class java.util.HashMap<K,V>

getReverse

public java.util.Map<V,K> getReverse()


Copyright © 2007 JUG Padova Parancoe Team. All Rights Reserved.