K
- the type of the keyV
- the type of the valuepublic class BidirectionalMap<K,V> extends Object
Constructor and Description |
---|
BidirectionalMap()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
K |
getByValue(V value)
Returns the key belonging to the given value.
|
V |
getValue(K key)
Returns the value belonging to the given key.
|
Set<K> |
keys()
Returns all keys.
|
void |
put(K key,
V value)
Associates the specified value with the specified key in this map
and vice versa.
|
V |
removeByKey(K key)
Removes the bidirectional mapping for the given key.
|
K |
removeByValue(V value)
Removes the bidirectional mapping for the given value.
|
Set<V> |
values()
Returns all values.
|
public void put(K key, V value)
key
- the keyvalue
- the valuepublic V removeByKey(K key)
key
- the key to be removedpublic K removeByValue(V value)
value
- the value to be removedpublic V getValue(K key)
key
- the key whose value should be looked uppublic K getByValue(V value)
value
- the key whose value should be looked upCopyright © 2019. All rights reserved.