Package fr.andross.banitem.utils
Class DoubleMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
fr.andross.banitem.utils.DoubleMap<K,V>
- Type Parameters:
K
- The map key typeV
- The map value type
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<K,
V>
- Direct Known Subclasses:
CustomItems
,MetaItems
A simple double map, used to handle custom and meta items.
- Version:
- 3.1
- Author:
- Andross
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Will clear the map and its reversed one.Get the key of this value from the reversed map.Get the reversed map.Adding in both maps.Remove the key from both maps.Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
DoubleMap
public DoubleMap()Creates a new DoubleMap with default settings.
-
-
Method Details
-
put
Adding in both maps. -
clear
public void clear()Will clear the map and its reversed one. -
remove
Remove the key from both maps. -
getKey
Get the key of this value from the reversed map.- Parameters:
value
- value- Returns:
- the key of this value if exists, otherwise null
-
getReversed
Get the reversed map.- Returns:
- the reversed map
-