public class BiHashMap<K,V>
extends java.lang.Object
implements java.util.Map<K,V>
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<K,V> |
forward
The forward map.
|
protected java.util.HashMap<V,K> |
reverse
The reverse map.
|
Constructor and Description |
---|
BiHashMap() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the map.
|
boolean |
containsKey(java.lang.Object key)
Returns whether the forward map contains the specified key.
|
boolean |
containsValue(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.
|
V |
get(java.lang.Object key)
Returns the value of the key from the forward map.
|
boolean |
isEmpty()
Tests if the map is empty.
|
java.util.Set<K> |
keySet()
Returns the keys of the forward map.
|
V |
put(K key,
V value)
Puts an entry into the map, forward direction.
|
void |
putAll(java.util.Map<? extends K,? extends V> m)
Puts all entries of a map into this map, forward direction.
|
V |
remove(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.
|
K |
rget(java.lang.Object key)
Returns the value of the key from the reverse map.
|
void |
rputAll(java.util.Map<? extends V,? extends K> m)
Puts all entries of a map into this map, reverse direction.
|
K |
rremove(java.lang.Object key)
Removes an entry, reverse direction.
|
int |
size()
Returns the size of the map.
|
java.util.Collection<V> |
values()
Returns the keys of the reverse map.
|
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
public java.util.Set<java.util.Map.Entry<V,K>> rentrySet()
public V get(java.lang.Object key)
public K rget(java.lang.Object key)
public boolean isEmpty()
public java.util.Set<K> keySet()
public int size()
public V remove(java.lang.Object key)
public K rremove(java.lang.Object key)
key
- The entry key.public void putAll(java.util.Map<? extends K,? extends V> m)
public void rputAll(java.util.Map<? extends V,? extends K> m)
m
- The map.