K - Type for the keys.V - Type for the values.public final class BidirectionalMap<K,V> extends Object implements Iterable<Map.Entry<K,V>>
| Constructor and Description |
|---|
BidirectionalMap() |
| Modifier and Type | Method and Description |
|---|---|
K |
getKey(Object value)
Retrieve a key from a value.
|
K |
getKeyOr(V value,
K replacementValue)
Get a key from a value, or return the given one.
|
List<K> |
getKeys() |
V |
getValue(K key)
Retrieve the value from the key.
|
List<V> |
getValues() |
Iterator<Map.Entry<K,V>> |
iterator() |
void |
put(K key,
V value)
Add a key and its value to the map.
|
void |
remove(K key)
Remove a key and its values from the containers.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic K getKey(Object value)
value - Stored value.public K getKeyOr(V value, K replacementValue)
value - Value matching the key.replacementValue - Value to return in case if the given does not match the key.public V getValue(K key)
key - Stored key.public void put(K key, V value)
key - The map key.value - The value associated to the key.public void remove(K key)
key - Object to remove.Copyright © 2017. All rights reserved.