Package org.zkoss.zkmax.bind.ext

## 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:
    `java.io.Serializable`, `java.util.Map<K,​V>`

      public class StandardBiMap<K,​V>
      extends ForwardingMap<K,​V>
      implements java.io.Serializable

  A general-purpose bimap implementation using any two backing `Map` instances.
  Author:
    Kevin Bourrillion, Mike Bostock
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface java.util.Map

      `java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `StandardBiMap​(java.util.Map<K,​V> forward, java.util.Map<V,​K> backward)` | Package-private constructor for creating a map-backed bimap.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `checkArgument​(boolean expression)` |
    `static void` | `checkArgument​(boolean expression, java.lang.Object errorMessage)` |
    `static void` | `checkArgument​(boolean expression, java.lang.String errorMessageTemplate, java.lang.Object... errorMessageArgs)` |
    `static void` | `checkState​(boolean expression)` |
    `static void` | `checkState​(boolean expression, java.lang.Object errorMessage)` |
    `void` | `clear()` |
    `boolean` | `containsValue​(java.lang.Object value)` |
    `java.util.Map<K,​V>` | `delegate()` |
    `java.util.Set<java.util.Map.Entry<K,​V>>` | `entrySet()` |
    `V` | `forcePut​(K key, V value)` |
    `StandardBiMap<V,​K>` | `inverse()` |
    `java.util.Set<K>` | `keySet()` |
    `V` | `put​(K key, V value)` |
    `void` | `putAll​(java.util.Map<? extends K,​? extends V> map)` |
    `protected V` | `putInBothMaps​(K key, V value, boolean force)` |
    `V` | `remove​(java.lang.Object key)` |
    `protected V` | `removeFromBothMaps​(java.lang.Object key)` |
    `protected void` | `removeFromInverseMap​(V oldValue)` |
    `protected void` | `setDelegates​(java.util.Map<K,​V> forward, java.util.Map<V,​K> backward)` | Specifies the delegate maps going in each direction.
    `protected void` | `updateInverseMap​(K key, boolean containedKey, V oldValue, V newValue)` |
    `java.util.Set<V>` | `values()` |

    - ### Methods inherited from class org.zkoss.zkmax.bind.ext.ForwardingMap

      `containsKey, createEntrySet, createKeySet, createValues, equals, get, hashCode, isEmpty, size, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

- - ### Constructor Detail

    - #### StandardBiMap

          protected StandardBiMap​(java.util.Map<K,​V> forward,
                                  java.util.Map<V,​K> backward)

      Package-private constructor for creating a map-backed bimap.

  - ### Method Detail

    - #### delegate

          public java.util.Map<K,​V> delegate()

      Specified by:
        `delegate` in class `ForwardingMap<K,​V>`

    - #### setDelegates

          protected void setDelegates​(java.util.Map<K,​V> forward,
                                      java.util.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​(java.lang.Object value)

      Specified by:
        `containsValue` in interface `java.util.Map<K,​V>`
      Overrides:
        `containsValue` in class `ForwardingMap<K,​V>`

    - #### put

          public V put​(K key,
                       V value)

      Specified by:
        `put` in interface `java.util.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​(java.lang.Object key)

      Specified by:
        `remove` in interface `java.util.Map<K,​V>`
      Overrides:
        `remove` in class `ForwardingMap<K,​V>`

    - #### removeFromBothMaps

          protected V removeFromBothMaps​(java.lang.Object key)

    - #### removeFromInverseMap

          protected void removeFromInverseMap​(V oldValue)

    - #### putAll

          public void putAll​(java.util.Map<? extends K,​? extends V> map)

      Specified by:
        `putAll` in interface `java.util.Map<K,​V>`
      Overrides:
        `putAll` in class `ForwardingMap<K,​V>`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `java.util.Map<K,​V>`
      Overrides:
        `clear` in class `ForwardingMap<K,​V>`

    - #### inverse

          public StandardBiMap<V,​K> inverse()

    - #### keySet

          public java.util.Set<K> keySet()

      Specified by:
        `keySet` in interface `java.util.Map<K,​V>`
      Overrides:
        `keySet` in class `ForwardingMap<K,​V>`

    - #### values

          public java.util.Set<V> values()

      Specified by:
        `values` in interface `java.util.Map<K,​V>`
      Overrides:
        `values` in class `ForwardingMap<K,​V>`

    - #### entrySet

          public java.util.Set<java.util.Map.Entry<K,​V>> entrySet()

      Specified by:
        `entrySet` in interface `java.util.Map<K,​V>`
      Overrides:
        `entrySet` in class `ForwardingMap<K,​V>`

    - #### checkState

          public static void checkState​(boolean expression)

    - #### checkState

          public static void checkState​(boolean expression,
                                        java.lang.Object errorMessage)

    - #### checkArgument

          public static void checkArgument​(boolean expression)

    - #### checkArgument

          public static void checkArgument​(boolean expression,
                                           java.lang.Object errorMessage)

    - #### checkArgument

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