Package jadex.commons.collection
Class BiHashMap<K,V>
- java.lang.Object
- 
- jadex.commons.collection.BiHashMap<K,V>
 
- 
- All Implemented Interfaces:
- java.util.Map<K,V>
 
 public class BiHashMap<K,V> extends java.lang.Object implements java.util.Map<K,V>A bidirectional hash map. Note using this implies a bijection (1:1 relation).
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the map.booleancontainsKey(java.lang.Object key)Returns whether the forward map contains the specified key.booleancontainsValue(java.lang.Object value)Returns whether the reverse map contains the specified key.java.util.Set<java.util.Map.Entry<K,V>>entrySet()Returns the entry set of the forward map.BiHashMap<V,K>flip()Returns a flipped map, sharing the data with the original map.Vget(java.lang.Object key)Returns the value of the key from the forward map.booleanisEmpty()Tests if the map is empty.java.util.Set<K>keySet()Returns the keys of the forward map.Vput(K key, V value)Puts an entry into the map, forward direction.voidputAll(java.util.Map<? extends K,? extends V> m)Puts all entries of a map into this map, forward direction.Vremove(java.lang.Object key)Removes an entry, forward direction.java.util.Set<java.util.Map.Entry<V,K>>rentrySet()Returns the entry set of the reverse map.Krget(java.lang.Object key)Returns the value of the key from the reverse map.voidrputAll(java.util.Map<? extends V,? extends K> m)Puts all entries of a map into this map, reverse direction.Krremove(java.lang.Object key)Removes an entry, reverse direction.intsize()Returns the size of the map.java.util.Collection<V>values()Returns the keys of the reverse map.
 
- 
- 
- 
Method Detail- 
containsKeypublic boolean containsKey(java.lang.Object key) Returns whether the forward map contains the specified key.
 - 
containsValuepublic boolean containsValue(java.lang.Object value) Returns whether the reverse map contains the specified key.
 - 
entrySetpublic java.util.Set<java.util.Map.Entry<K,V>> entrySet() Returns the entry set of the forward map.
 - 
rentrySetpublic java.util.Set<java.util.Map.Entry<V,K>> rentrySet() Returns the entry set of the reverse map.- Returns:
- The entry set of the reverse map.
 
 - 
getpublic V get(java.lang.Object key) Returns the value of the key from the forward map.
 - 
rgetpublic K rget(java.lang.Object key) Returns the value of the key from the reverse map.- Returns:
- The value.
 
 - 
isEmptypublic boolean isEmpty() Tests if the map is empty.
 - 
keySetpublic java.util.Set<K> keySet() Returns the keys of the forward map.
 - 
sizepublic int size() Returns the size of the map.
 - 
removepublic V remove(java.lang.Object key) Removes an entry, forward direction.
 - 
rremovepublic K rremove(java.lang.Object key) Removes an entry, reverse direction.- Parameters:
- key- The entry key.
- Returns:
- The removed value.
 
 - 
putAllpublic void putAll(java.util.Map<? extends K,? extends V> m) Puts all entries of a map into this map, forward direction.
 - 
rputAllpublic void rputAll(java.util.Map<? extends V,? extends K> m) Puts all entries of a map into this map, reverse direction.- Parameters:
- m- The map.
 
 - 
valuespublic java.util.Collection<V> values() Returns the keys of the reverse map.
 
- 
 
-