java.lang.Object
com.github.hypfvieh.collections.BidiMap<K,V>
Alle implementierten Schnittstellen:
Map<K,V>

public class BidiMap<K,V> extends Object implements Map<K,V>
A bidirectional map. If created from an existing map, the original map is not modified. Instead a new Map objects of the same type are created for a copy of the original map and an inverted map. Should this fail, the type defaults to LinkedHashMap. Combinations of key-value must be unique in order to create and maintain the corresponding inverse map. In addition, null is not accepted as a valid value, as it is not permitted as a map key. In these cases IllegalArgumentException is thrown. The map requires external synchronization.
  • Konstruktordetails

    • BidiMap

      public BidiMap()
    • BidiMap

      public BidiMap(Map<K,V> _map)
  • Methodendetails

    • get

      public V get(Object _key)
      Angegeben von:
      get in Schnittstelle Map<K,V>
    • getKey

      public K getKey(V _val)
    • containsKey

      public boolean containsKey(Object _key)
      Angegeben von:
      containsKey in Schnittstelle Map<K,V>
    • containsValue

      public boolean containsValue(Object _val)
      Angegeben von:
      containsValue in Schnittstelle Map<K,V>
    • size

      public int size()
      Angegeben von:
      size in Schnittstelle Map<K,V>
    • isEmpty

      public boolean isEmpty()
      Angegeben von:
      isEmpty in Schnittstelle Map<K,V>
    • keySet

      public Set<K> keySet()
      Angegeben von:
      keySet in Schnittstelle Map<K,V>
    • values

      public Collection<V> values()
      Angegeben von:
      values in Schnittstelle Map<K,V>
    • entrySet

      public Set<Map.Entry<K,V>> entrySet()
      Angegeben von:
      entrySet in Schnittstelle Map<K,V>
    • remove

      public V remove(Object _key)
      Angegeben von:
      remove in Schnittstelle Map<K,V>
    • removeValue

      public K removeValue(V _val)
      Removes the mapping for a value from this map if it is present.
      Parameter:
      _val - value whose mapping is to be removed from the map
      Gibt zurück:
      the previous key associated with value.
    • put

      public V put(K _key, V _val)
      Angegeben von:
      put in Schnittstelle Map<K,V>
    • putAll

      public void putAll(Map<? extends K,? extends V> _map)
      Angegeben von:
      putAll in Schnittstelle Map<K,V>
    • clear

      public void clear()
      Angegeben von:
      clear in Schnittstelle Map<K,V>
    • toString

      public final String toString()
      Setzt außer Kraft:
      toString in Klasse Object