|
||||||||||
| 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
com.foxsmart.ic.lang.OrderedHashMap
public class OrderedHashMap
This class provides the functionality of a Hash Map while maintaining the order of entered items.
| Constructor Summary | |
|---|---|
OrderedHashMap()
Constructs a new, empty OrderedHashMap with the JDK default capacity and load factor. |
|
OrderedHashMap(int initialCapacity)
Constructs a new, empty OrderedHashMap with the specified initial capacity and the default JDK load factor. |
|
OrderedHashMap(int initialCapacity,
float loadFactor)
Constructs a new, empty OrderedHashMap with the specified initial capacity and the specified load factor. |
|
OrderedHashMap(java.util.Map map)
Constructs a new OrderedHashMap with the same mappings as the given map. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all mappings from this map. |
java.lang.Object |
clone()
Returns a shallow copy of this HashMap instance: the keys and values themselves are not cloned. |
java.util.List |
keyList()
Returns the list of keys in the order they were entered into the hash map. |
static void |
main(java.lang.String[] args)
Test Driver. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associates the specified value with the specified key in this map. |
void |
putAll(java.util.Map map)
Copies all of the mappings from the specified map to this one. |
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for this key from this map if present. |
int |
size()
Returns the number of entries in the hash map. |
java.util.Collection |
values()
Returns an ordered collection of the values contained in this map. |
| Methods inherited from class java.util.HashMap |
|---|
containsKey, containsValue, entrySet, get, isEmpty, keySet |
| 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 of the OrderedHashMap
public OrderedHashMap(int initialCapacity,
float loadFactor)
initialCapacity - The initial capacity of the OrderedHashMaploadFactor - The initial load factor of the OrderedHashMappublic OrderedHashMap(java.util.Map map)
map - The map to initialize the OrderedHashMap with| Method Detail |
|---|
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class java.util.HashMapkey - Key with which the specified vlaue is to be associated.value - Value to be associated with the specified key.
public void putAll(java.util.Map map)
putAll in interface java.util.MapputAll in class java.util.HashMapmap - Mappings to be stored in this mappublic void clear()
clear in interface java.util.Mapclear in class java.util.HashMappublic java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mapremove in class java.util.HashMapkey - Key whose mapping is to be removed from the map.
public java.util.Collection values()
values in interface java.util.Mapvalues in class java.util.HashMappublic java.util.List keyList()
public int size()
size in interface java.util.Mapsize in class java.util.HashMappublic java.lang.Object clone()
clone in class java.util.HashMappublic static void main(java.lang.String[] args)
args - the arguments
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||