Class SimpleConcurrentBidiMap<K,V>
java.lang.Object
com.levigo.jadice.web.server.util.SimpleConcurrentBidiMap<K,V>
- Type Parameters:
K
-V
-
A simple implementation of a concurrent bidirectional map.
Currently, only remove and overwrite operations are supported.
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRemoves the mapping for a key from this map if it is present (optional operation).removeByValue
(V value) Removes the mapping for a value from this map if it is present (optional operation).Inserts the value for the given key.
-
Field Details
-
keyToValueMap
-
valueToKeyMap
-
-
Constructor Details
-
SimpleConcurrentBidiMap
public SimpleConcurrentBidiMap()
-
-
Method Details
-
upsert
Inserts the value for the given key. Updates the value if the key is already present. Returns the previous value if present.- Parameters:
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key- Returns:
- previous value if present
-
remove
Removes the mapping for a key from this map if it is present (optional operation).- Parameters:
key
- key whose mapping is to be removed from the map- Returns:
- the previous value associated with
key
, ornull
if there was no mapping forkey
.
-
removeByValue
Removes the mapping for a value from this map if it is present (optional operation).- Parameters:
value
- value that is to be removed from the map- Returns:
- the previous key associated with
value
, ornull
if there was no mapping forvalue
.
-