|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
org.clapper.util.misc.OrderedHashMap<K,V>
public class OrderedHashMap<K,V>
An OrderedHashMap is a java.util.HashMap with one additional property: It maintains a list of the map's keys in the order they were added to the map. This additional capability imposes a small amount of extra overhead on insertion and a larger amount of overhead on key removal, but absolutely no additional key lookup overhead. This class is conceptually similar to (though less feature-rich than) the java.util.LinkedHashMap class added in JDK 1.4.
keysInInsertionOrder(),
getKeysInInsertionOrder(java.util.List super K>),
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
| Constructor Summary | |
|---|---|
OrderedHashMap()
Deprecated. Construct a new empty map with a default capacity and load factor. |
|
OrderedHashMap(int initialCapacity)
Deprecated. Construct a new empty map with the specified initial capacity and a default load factor. |
|
OrderedHashMap(int initialCapacity,
float loadFactor)
Deprecated. Constructs a new, empty map with the specified initial capacity and the specified load factor. |
|
OrderedHashMap(java.util.Map<? extends K,? extends V> map)
Deprecated. Constructs a new map with the same mappings as the given map. |
|
OrderedHashMap(OrderedHashMap<? extends K,? extends V> map)
Deprecated. Constructs a new map with the same mappings as the given OrderedHashMap. |
|
| Method Summary | |
|---|---|
void |
clear()
Deprecated. Remove all mappings from this map. |
java.lang.Object |
clone()
Deprecated. Returns a shallow copy of this instance. |
int |
getKeysInInsertionOrder(java.util.List<? super K> list)
Deprecated. Get the keys in the order they were added to this map. |
java.util.List<K> |
keysInInsertionOrder()
Deprecated. Get the keys in the order they were added to this map. |
V |
put(K key,
V value)
Deprecated. Associates the specified value with the specified key in this map. |
void |
putAll(java.util.Map<? extends K,? extends V> map)
Deprecated. Copies all of the mappings from a specified map to this one. |
void |
putAll(OrderedHashMap<? extends K,? extends V> map)
Deprecated. Copies all of the mappings from a specified map to this one. |
V |
remove(java.lang.Object key)
Deprecated. Removes the mapping for a key, if there is one. |
| Methods inherited from class java.util.HashMap |
|---|
containsKey, containsValue, entrySet, get, isEmpty, keySet, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public OrderedHashMap()
public OrderedHashMap(int initialCapacity)
initialCapacity - the initial capacity
public OrderedHashMap(int initialCapacity,
float loadFactor)
initialCapacity - the initial capacityloadFactor - the load factorpublic OrderedHashMap(java.util.Map<? extends K,? extends V> map)
map - the map whose mappings are to be copiedOrderedHashMap(OrderedHashMap)public OrderedHashMap(OrderedHashMap<? extends K,? extends V> map)
map - the map whose mappings are to be copied| Method Detail |
|---|
public int getKeysInInsertionOrder(java.util.List<? super K> list)
list - the List to receive the keys
keysInInsertionOrder()public java.util.List<K> keysInInsertionOrder()
getKeysInInsertionOrder(java.util.List super K>)public java.lang.Object clone()
clone in class java.util.HashMap<K,V>public void clear()
clear in interface java.util.Map<K,V>clear in class java.util.HashMap<K,V>
public V put(K key,
V value)
put in interface java.util.Map<K,V>put in class java.util.HashMap<K,V>key - the key with which the specified value is to be associatedvalue - the value to associate with the specified key
public void putAll(java.util.Map<? extends K,? extends V> map)
putAll in interface java.util.Map<K,V>putAll in class java.util.HashMap<K,V>map - the map whose mappings are to be copiedputAll(OrderedHashMap)public void putAll(OrderedHashMap<? extends K,? extends V> map)
map - the map whose mappings are to be copiedputAll(OrderedHashMap),
keysInInsertionOrder()public V remove(java.lang.Object key)
remove in interface java.util.Map<K,V>remove in class java.util.HashMap<K,V>key - the key to remove
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||