public class HashBiMap<K,V> extends Object implements BiMap<K,V>, Serializable
HashMap
based implementation of a BiMap
. Given an existing
Map
, all values will be mapped to their original keys in a new hash
map.Constructor and Description |
---|
HashBiMap()
Creates an empty
HashBiMap |
HashBiMap(Map<K,V> map)
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object key) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object o) |
V |
get(Object o) |
int |
hashCode() |
BiMap<V,K> |
inverse()
|
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
String |
toString()
Returns a string description of the mappings.
|
Collection<V> |
values() |
public HashBiMap()
HashBiMap
public HashBiMap(Map<K,V> map)
IllegalArgumentException
- if the mapping is not bijectivepublic boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object key)
containsValue
in interface Map<K,V>
public boolean equals(Object o)
public int hashCode()
public String toString()
Copyright © 2012. All Rights Reserved.