Package org.cip4.jdflib.util
Class BiHashMap<a,b>
- java.lang.Object
-
- org.cip4.jdflib.util.BiHashMap<a,b>
-
- Type Parameters:
a- any datatype for the keyb- any datatype for the value
- All Implemented Interfaces:
java.util.Map<a,b>
public class BiHashMap<a,b> extends java.lang.Object implements java.util.Map<a,b>Bidirectional HashMap utility class
-
-
Constructor Summary
Constructors Constructor Description BiHashMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()get the value for keybooleancontainsKey(java.lang.Object arg0)booleancontainsValue(java.lang.Object arg0)java.util.Set<java.util.Map.Entry<a,b>>entrySet()bget(java.lang.Object arg0)agetKey(b val)get the value for keyjava.util.Iterator<a>getKeyIterator()java.util.Map<a,b>getKeyMap()get a reference to the internal key mapjava.util.Map<b,a>getValMap()get a reference to the internal value mapbgetValue(a key)get the value for keybooleanisEmpty()java.util.Set<a>keySet()bput(a key, b val)put the value for key
both key and value must be non-nullvoidputAll(java.util.Map<? extends a,? extends b> arg0)bremove(java.lang.Object key)remove key and its associated valuearemoveVal(java.lang.Object value)remove value and its associated keyvoidsetUnique(boolean b)TODO Please insert comment!intsize()java.lang.StringtoString()java.util.Collection<b>values()
-
-
-
Method Detail
-
getValue
public b getValue(a key)
get the value for key- Parameters:
key- the key- Returns:
- the corresponding value
-
getKeyIterator
public java.util.Iterator<a> getKeyIterator()
- Returns:
- the corresponding key iterator
-
getKey
public a getKey(b val)
get the value for key- Parameters:
val- the value- Returns:
- the corresponding key
-
remove
public b remove(java.lang.Object key)
remove key and its associated value
-
removeVal
public a removeVal(java.lang.Object value)
remove value and its associated key- Parameters:
value- the value- Returns:
-
clear
public void clear()
get the value for key
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
containsKey
public boolean containsKey(java.lang.Object arg0)
-
containsValue
public boolean containsValue(java.lang.Object arg0)
-
get
public b get(java.lang.Object arg0)
-
isEmpty
public boolean isEmpty()
-
keySet
public java.util.Set<a> keySet()
-
size
public int size()
-
values
public java.util.Collection<b> values()
-
setUnique
public void setUnique(boolean b)
TODO Please insert comment!- Parameters:
b-
-
-