public class OrderedMap<K,V> extends ObjectMap<K,V>
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().ObjectMap.Entries<K,V>, ObjectMap.Entry<K,V>, ObjectMap.Keys<K>, ObjectMap.Values<V>| Constructor and Description |
|---|
OrderedMap() |
OrderedMap(int initialCapacity) |
OrderedMap(int initialCapacity,
float loadFactor) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
ObjectMap.Entries<K,V> |
entries()
Returns an iterator for the entries in the map.
|
ObjectMap.Keys<K> |
keys()
Returns an iterator for the keys in the map.
|
Array<K> |
orderedKeys() |
V |
put(K key,
V value)
Returns the old value associated with the specified key, or null.
|
V |
remove(K key) |
java.lang.String |
toString() |
ObjectMap.Values<V> |
values()
Returns an iterator for the values in the map.
|
containsKey, containsValue, ensureCapacity, findKey, get, get, putAllpublic OrderedMap()
public OrderedMap(int initialCapacity)
public OrderedMap(int initialCapacity,
float loadFactor)
public V put(K key, V value)
ObjectMappublic ObjectMap.Entries<K,V> entries()
ObjectMapObjectMap.Entries constructor for nested or multithreaded iteration.public ObjectMap.Keys<K> keys()
ObjectMapObjectMap.Entries constructor for nested or multithreaded iteration.public ObjectMap.Values<V> values()
ObjectMapObjectMap.Entries constructor for nested or multithreaded iteration.