|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
gov.nih.nlm.util.OrderedHashMap
A HashMap
that maintains the order in which elements were added.
Constructor Summary | |
OrderedHashMap()
Instantiates an empty OrderedHashMap . |
|
OrderedHashMap(int capacity)
Instantiates an empty OrderedHashMap with the specified capacity. |
|
OrderedHashMap(int capacity,
float load_factor)
Instantiates an empty OrderedHashMap with the specified capacity
and load factor. |
|
OrderedHashMap(Map map)
Instantiates an OrderedHashMap from an existing Map . |
Method Summary | |
void |
clear()
Clears the map. |
Object |
getKey(int index)
Returns the Object key for a specified index. |
Object |
getValue(int index)
Returns the Object value for a specified index. |
List |
orderedKeySet()
Returns the key set as an ordered List . |
Object |
put(Object key,
Object value)
Adds a key/value pair. |
void |
putAll(Map map)
Adds all elements from the specified Map . |
Object |
remove(Object key)
Removes the mapping for the specified key. |
Methods inherited from class java.util.HashMap |
clone, 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()
OrderedHashMap
.
public OrderedHashMap(int capacity)
OrderedHashMap
with the specified capacity.
capacity
- the initial capacitypublic OrderedHashMap(int capacity, float load_factor)
OrderedHashMap
with the specified capacity
and load factor.
capacity
- the initial capacityload_factor
- the load factorpublic OrderedHashMap(Map map)
OrderedHashMap
from an existing Map
.
map
- the mapMethod Detail |
public Object put(Object key, Object value)
key
- the keyvalue
- the value
Object
public void putAll(Map map)
Map
.
map
- the Map
public Object getKey(int index)
Object
key for a specified index.
index
- an index into the ordered list
Object
public Object getValue(int index)
Object
value for a specified index.
index
- an index into the ordered list
Object
public Object remove(Object key)
key
- the key
public void clear()
public List orderedKeySet()
List
.
List
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |