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 backingMap
instances.- Author:
- Kevin Bourrillion, Mike Bostock
- See Also:
- Serialized Form
-
-
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
-
-
-
-
Method Detail
-
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 interfacejava.util.Map<K,V>
- Overrides:
containsValue
in classForwardingMap<K,V>
-
updateInverseMap
protected void updateInverseMap(K key, boolean containedKey, V oldValue, V newValue)
-
remove
public V remove(java.lang.Object key)
-
removeFromBothMaps
protected V removeFromBothMaps(java.lang.Object key)
-
removeFromInverseMap
protected void removeFromInverseMap(V oldValue)
-
clear
public void clear()
-
inverse
public StandardBiMap<V,K> inverse()
-
keySet
public java.util.Set<K> keySet()
-
values
public java.util.Set<V> values()
-
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)
-
-