Package net.dermetfan.gdx.utils
Class DualObjectMap<K,V>
java.lang.Object
net.dermetfan.gdx.utils.DualObjectMap<K,V>
Two
ObjectMaps holding each other's contents in reverse for fast retrieval of both keys and values.
This causes null values not to be allowed.- Since:
- 0.6.0
-
Constructor Summary
ConstructorsConstructorDescriptionDualObjectMap(int initialCapacity) DualObjectMap(int initialCapacity, float loadFactor) DualObjectMap(com.badlogic.gdx.utils.ObjectMap<K, V> map) DualObjectMap(DualObjectMap<K, V> map) -
Method Summary
Modifier and TypeMethodDescriptionvoidremoveValue(V value) like whatobjectMap.remove(objectMap.findKey(value))would do
-
Constructor Details
-
DualObjectMap
public DualObjectMap()- See Also:
-
DualObjectMap
public DualObjectMap(int initialCapacity) - See Also:
-
DualObjectMap
public DualObjectMap(int initialCapacity, float loadFactor) - See Also:
-
DualObjectMap
- See Also:
-
DualObjectMap
- Parameters:
map- the map to copy
-
-
Method Details
-
put
- See Also:
-
getKey
- Returns:
- the key of the given value as
ObjectMap.findKey(Object, boolean)would return
-
getValue
- See Also:
-
removeKey
- See Also:
-
removeValue
like whatobjectMap.remove(objectMap.findKey(value))would do -
getKeyToValue
- Returns:
- The
keyToValue. Only use this if you know what you're doing! - Since:
- 0.7.1
-
getValueToKey
- Returns:
- The
valueToKey. Only use this if you know what you're doing! - Since:
- 0.7.1
-