Class BiHashMap<a,b>

java.lang.Object
org.cip4.jdflib.util.BiHashMap<a,b>
Type Parameters:
a - any datatype for the key
b - any datatype for the value
All Implemented Interfaces:
Map<a,b>

public class BiHashMap<a,b> extends Object implements Map<a,b>
Bidirectional HashMap utility class
  • Constructor Details

    • BiHashMap

      public BiHashMap()
  • Method Details

    • getValue

      public b getValue(a key)
      get the value for key
      Parameters:
      key - the key
      Returns:
      the corresponding value
    • getKeyIterator

      public 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(Object key)
      remove key and its associated value
      Specified by:
      remove in interface Map<a,b>
      Parameters:
      key - the key
      Returns:
    • removeVal

      public a removeVal(Object value)
      remove value and its associated key
      Parameters:
      value - the value
      Returns:
    • put

      public b put(a key, b val)
      put the value for key
      both key and value must be non-null
      Specified by:
      put in interface Map<a,b>
      Parameters:
      key - the key
      val - the value
      Returns:
    • clear

      public void clear()
      get the value for key
      Specified by:
      clear in interface Map<a,b>
    • getKeyMap

      public Map<a,b> getKeyMap()
      get a reference to the internal key map
      Returns:
    • getValMap

      public Map<b,a> getValMap()
      get a reference to the internal value map
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • containsKey

      public boolean containsKey(Object arg0)
      Specified by:
      containsKey in interface Map<a,b>
      Parameters:
      arg0 -
      Returns:
      See Also:
    • containsValue

      public boolean containsValue(Object arg0)
      Specified by:
      containsValue in interface Map<a,b>
      Parameters:
      arg0 -
      Returns:
      See Also:
    • entrySet

      public Set<Map.Entry<a,b>> entrySet()
      Specified by:
      entrySet in interface Map<a,b>
      Returns:
      See Also:
    • get

      public b get(Object arg0)
      Specified by:
      get in interface Map<a,b>
      Parameters:
      arg0 -
      Returns:
      See Also:
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<a,b>
      Returns:
      See Also:
    • keySet

      public Set<a> keySet()
      Specified by:
      keySet in interface Map<a,b>
      Returns:
      See Also:
    • putAll

      public void putAll(Map<? extends a,? extends b> arg0)
      Specified by:
      putAll in interface Map<a,b>
      Parameters:
      arg0 -
      See Also:
    • size

      public int size()
      Specified by:
      size in interface Map<a,b>
      Returns:
      See Also:
    • values

      public Collection<b> values()
      Specified by:
      values in interface Map<a,b>
      Returns:
      See Also:
    • setUnique

      public void setUnique(boolean b)
      TODO Please insert comment!
      Parameters:
      b -