com.badlogic.gdx.utils
Class OrderedMap<K,V>
java.lang.Object
com.badlogic.gdx.utils.ObjectMap<K,V>
com.badlogic.gdx.utils.OrderedMap<K,V>
public class OrderedMap<K,V>
- extends ObjectMap<K,V>
An ObjectMap
that also stores keys in an Array
using the insertion order. There is some additional overhead for
put and remove. Iteration over the entries()
, keys()
, and values()
is ordered. Keys can also be
accessed and the order changed using orderedKeys()
.
- Author:
- Nathan Sweet
Fields inherited from class com.badlogic.gdx.utils.ObjectMap |
size |
OrderedMap
public OrderedMap()
OrderedMap
public OrderedMap(int initialCapacity)
OrderedMap
public OrderedMap(int initialCapacity,
float loadFactor)
put
public V put(K key,
V value)
- Description copied from class:
ObjectMap
- Returns the old value associated with the specified key, or null.
- Overrides:
put
in class ObjectMap<K,V>
remove
public V remove(K key)
- Overrides:
remove
in class ObjectMap<K,V>
clear
public void clear(int maximumCapacity)
- Description copied from class:
ObjectMap
- Clears the map and reduces the size of the backing arrays to be the specified capacity if they are larger.
- Overrides:
clear
in class ObjectMap<K,V>
clear
public void clear()
- Overrides:
clear
in class ObjectMap<K,V>
orderedKeys
public Array<K> orderedKeys()
entries
public ObjectMap.Entries<K,V> entries()
- Description copied from class:
ObjectMap
- Returns an iterator for the entries in the map. Remove is supported. Note that the same iterator instance is returned each
time this method is called. Use the
ObjectMap.Entries
constructor for nested or multithreaded iteration.
- Overrides:
entries
in class ObjectMap<K,V>
keys
public ObjectMap.Keys<K> keys()
- Description copied from class:
ObjectMap
- Returns an iterator for the keys in the map. Remove is supported. Note that the same iterator instance is returned each time
this method is called. Use the
ObjectMap.Entries
constructor for nested or multithreaded iteration.
- Overrides:
keys
in class ObjectMap<K,V>
values
public ObjectMap.Values<V> values()
- Description copied from class:
ObjectMap
- Returns an iterator for the values in the map. Remove is supported. Note that the same iterator instance is returned each
time this method is called. Use the
ObjectMap.Entries
constructor for nested or multithreaded iteration.
- Overrides:
values
in class ObjectMap<K,V>
toString
public String toString()
- Overrides:
toString
in class ObjectMap<K,V>
Copyright © 2013. All Rights Reserved.