Class StandardBiMap<K,V>

java.lang.Object
org.zkoss.zkmax.bind.ext.ForwardingMap<K,V>
org.zkoss.zkmax.bind.ext.StandardBiMap<K,V>
All Implemented Interfaces:
Serializable, Map<K,V>

public class StandardBiMap<K,V> extends ForwardingMap<K,V> implements Serializable
A general-purpose bimap implementation using any two backing Map instances.
Author:
Kevin Bourrillion, Mike Bostock
See Also:
  • Constructor Details

    • StandardBiMap

      protected StandardBiMap(Map<K,V> forward, Map<V,K> backward)
      Package-private constructor for creating a map-backed bimap.
  • Method Details

    • delegate

      public Map<K,V> delegate()
      Specified by:
      delegate in class ForwardingMap<K,V>
    • setDelegates

      protected void setDelegates(Map<K,V> forward, Map<V,K> backward)
      Specifies the delegate maps going in each direction. Called by the constructor and by subclasses during deserialization.
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<K,V>
      Overrides:
      containsValue in class ForwardingMap<K,V>
    • put

      public V put(K key, V value)
      Specified by:
      put in interface Map<K,V>
      Overrides:
      put in class ForwardingMap<K,V>
    • forcePut

      public V forcePut(K key, V value)
    • putInBothMaps

      protected V putInBothMaps(K key, V value, boolean force)
    • updateInverseMap

      protected void updateInverseMap(K key, boolean containedKey, V oldValue, V newValue)
    • remove

      public V remove(Object key)
      Specified by:
      remove in interface Map<K,V>
      Overrides:
      remove in class ForwardingMap<K,V>
    • removeFromBothMaps

      protected V removeFromBothMaps(Object key)
    • removeFromInverseMap

      protected void removeFromInverseMap(V oldValue)
    • putAll

      public void putAll(Map<? extends K,? extends V> map)
      Specified by:
      putAll in interface Map<K,V>
      Overrides:
      putAll in class ForwardingMap<K,V>
    • clear

      public void clear()
      Specified by:
      clear in interface Map<K,V>
      Overrides:
      clear in class ForwardingMap<K,V>
    • inverse

      public StandardBiMap<V,K> inverse()
    • keySet

      public Set<K> keySet()
      Specified by:
      keySet in interface Map<K,V>
      Overrides:
      keySet in class ForwardingMap<K,V>
    • values

      public Set<V> values()
      Specified by:
      values in interface Map<K,V>
      Overrides:
      values in class ForwardingMap<K,V>
    • entrySet

      public Set<Map.Entry<K,V>> entrySet()
      Specified by:
      entrySet in interface Map<K,V>
      Overrides:
      entrySet in class ForwardingMap<K,V>
    • checkState

      public static void checkState(boolean expression)
    • checkState

      public static void checkState(boolean expression, Object errorMessage)
    • checkArgument

      public static void checkArgument(boolean expression)
    • checkArgument

      public static void checkArgument(boolean expression, Object errorMessage)
    • checkArgument

      public static void checkArgument(boolean expression, String errorMessageTemplate, Object... errorMessageArgs)