Package net.dermetfan.gdx.utils
Class DualIntMap<V>
java.lang.Object
net.dermetfan.gdx.utils.DualIntMap<V>
public class DualIntMap<V>
extends java.lang.Object
an
IntMap
and ObjectIntMap
holding each others contents in reverse for fast retrieval of both keys and values- Since:
- 0.6.0
-
Constructor Summary
Constructors Constructor Description DualIntMap()
DualIntMap(int initialCapacity)
DualIntMap(int initialCapacity, float loadFactor)
DualIntMap(com.badlogic.gdx.utils.IntMap<V> map)
DualIntMap(DualIntMap<V> map)
-
Method Summary
Modifier and Type Method Description int
getKey(V value, int defaultKey)
com.badlogic.gdx.utils.IntMap<V>
getKeyToValue()
V
getValue(int key)
com.badlogic.gdx.utils.ObjectIntMap<V>
getValueToKey()
void
put(int key, V value)
V
removeKey(int key)
int
removeValue(V value, int defaultKey)
like whatintMap.remove(intMap.findKey(value, true, defaultValue))
would doMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DualIntMap
public DualIntMap()- See Also:
IntMap()
-
DualIntMap
public DualIntMap(int initialCapacity)- See Also:
IntMap(int)
-
DualIntMap
public DualIntMap(int initialCapacity, float loadFactor)- See Also:
IntMap(int, float)
-
DualIntMap
- See Also:
IntMap(IntMap)
-
DualIntMap
- Parameters:
map
- the map to copy
-
-
Method Details
-
put
- See Also:
IntMap.put(int, Object)
-
getKey
- Returns:
- the key of the given value as
IntMap.findKey(Object, boolean, int)
would return
-
getValue
- See Also:
IntMap.get(int)
-
removeKey
- See Also:
IntMap.remove(int)
-
removeValue
like whatintMap.remove(intMap.findKey(value, true, defaultValue))
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
-