Class BidiMap<K,V>
java.lang.Object
com.github.hypfvieh.collections.BidiMap<K,V>
- All Implemented Interfaces:
Map<K,V>
A bidirectional map.
If created from an existing map, the original map is not modified.
Instead a new Map objects of the same type
are created for a copy of the original map and an inverted map.
Should this fail, the type defaults to
LinkedHashMap.
Combinations of key-value must be unique in order to create and
maintain the corresponding inverse map. In addition, null is not accepted
as a valid value, as it is not permitted as a map key.
In these cases IllegalArgumentException is thrown.
The map requires external synchronization.-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object _key) booleancontainsValue(Object _val) entrySet()booleanisEmpty()keySet()voidremoveValue(V _val) Removes the mapping for a value from this map if it is present.intsize()final StringtoString()values()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
BidiMap
public BidiMap() -
BidiMap
-
-
Method Details
-
get
-
getKey
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
size
-
isEmpty
-
keySet
-
values
-
entrySet
-
remove
-
removeValue
-
put
-
putAll
-
clear
-
toString
-