Class DualIntMap<V>

java.lang.Object
net.dermetfan.gdx.utils.DualIntMap<V>

public class DualIntMap<V> extends Object
an IntMap and ObjectIntMap holding each others contents in reverse for fast retrieval of both keys and values
Since:
0.6.0
  • 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

      public DualIntMap(com.badlogic.gdx.utils.IntMap<V> map)
      See Also:
      • IntMap(IntMap)
    • DualIntMap

      public DualIntMap(DualIntMap<V> map)
      Parameters:
      map - the map to copy
  • Method Details

    • put

      public void put(int key, V value)
      See Also:
      • IntMap.put(int, Object)
    • getKey

      public int getKey(V value, int defaultKey)
      Returns:
      the key of the given value as IntMap.findKey(Object, boolean, int) would return
    • getValue

      public V getValue(int key)
      See Also:
      • IntMap.get(int)
    • removeKey

      public V removeKey(int key)
      See Also:
      • IntMap.remove(int)
    • removeValue

      public int removeValue(V value, int defaultKey)
      like what intMap.remove(intMap.findKey(value, true, defaultValue)) would do
    • getKeyToValue

      public com.badlogic.gdx.utils.IntMap<V> getKeyToValue()
      Returns:
      The keyToValue. Only use this if you know what you're doing!
      Since:
      0.7.1
    • getValueToKey

      public com.badlogic.gdx.utils.ObjectIntMap<V> getValueToKey()
      Returns:
      The valueToKey. Only use this if you know what you're doing!
      Since:
      0.7.1