|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.digi.config.util.ArrayMap
This class provides a map collection with a concept of insert order. That is, when iterating over the collection, they will be returned in the order they were inserted into the collection. Users are still free to operate on the collection as a map however.
| Nested Class Summary |
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Constructor Summary | |
ArrayMap()
Construct an empty ArrayMap |
|
ArrayMap(ArrayMap map)
Construct an ArrayMap and populate it with items from the specified map. |
|
ArrayMap(java.util.Map map)
Construct an ArrayMap and populate it with items from the specified map. |
|
| Method Summary | |
void |
clear()
Removes all items from the ArrayMap |
boolean |
containsKey(java.lang.Object key)
Indicates if the specified key is found in the ArrayMap |
boolean |
containsValue(java.lang.Object value)
Indicates if the specified value is found in the ArrayMap |
ArrayMap |
copy()
Creates a new ArrayMap containing the same elements and order as this ArrayMap. |
java.util.Set |
entrySet()
Returns the set of Map.Entrys for the ArrayMap Note: do not add or remove elements from the returned set as it will corrupt the contents of the ArrayMap. |
boolean |
equals(java.lang.Object o)
Compares the ArrayMap against the specified object |
java.lang.Object |
get(java.lang.Object key)
Looks for an object in the ArrayMap that was stored under the specified key. |
int |
hashCode()
Produces a hashcode for the ArrayMap |
boolean |
isEmpty()
Indicates if the ArrayMap is empty or not |
java.util.Set |
keySet()
Returns the set of keys for the ArrayMap Note: do not add or remove elements from the returned set as it will corrupt the contents of the ArrayMap |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Inserts an element into the collection under a specified lookup key. |
void |
putAll(java.util.Map t)
Inserts all items found in a specified map into the ArrayMap. |
java.lang.Object |
putAt(java.lang.Object key,
int position,
java.lang.Object value)
Inserts an element into the collection under a specified lookup key and in the specified position. |
java.lang.Object |
remove(java.lang.Object key)
Removes the element from the collection found under the specified lookup key. |
int |
size()
Returns the number of elements in the ArrayMap |
java.util.Collection |
values()
Returns the ordered collection of values found in the ArrayMap. |
java.util.List |
valuesList()
Returns the ordered List of values found in the ArrayMap. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ArrayMap()
public ArrayMap(java.util.Map map)
map - a map of the elements to be added to the ArrayMappublic ArrayMap(ArrayMap map)
map - a map of the elements to be added to the ArrayMap| Method Detail |
public int size()
size in interface java.util.Mappublic boolean isEmpty()
isEmpty in interface java.util.Mappublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Mapkey - the key to check for in the ArrayMappublic boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Mapvalue - the value to check for in the ArrayMappublic java.lang.Object get(java.lang.Object key)
get in interface java.util.Mapkey - the value to check for in the ArrayMap
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapkey - the lookup key for the item being insertedvalue - the item being stored in the collection
public java.lang.Object putAt(java.lang.Object key,
int position,
java.lang.Object value)
key - the lookup key for the item being insertedposition - the position in the ArrayMap to insert the item atvalue - the item being stored in the collectionpublic java.lang.Object remove(java.lang.Object key)
Note: this method performs a linear scan to locate item in ordered element portion of the ArrayMap
remove in interface java.util.Mapkey - the lookup key for the item being removed
public void putAll(java.util.Map t)
putAll in interface java.util.Mapt - the map whose items are to be added to the ArrayMappublic void clear()
clear in interface java.util.Mappublic java.util.Set keySet()
Note: do not add or remove elements from the returned set as it will corrupt the contents of the ArrayMap
keySet in interface java.util.Mappublic java.util.Collection values()
Note, this collection is not backed by the map. Adding or removing items from the returned collection will not affect the contents of the ArrayMap.
values in interface java.util.Mappublic java.util.Set entrySet()
Note: do not add or remove elements from the returned set as it will corrupt the contents of the ArrayMap.
entrySet in interface java.util.Mappublic boolean equals(java.lang.Object o)
equals in interface java.util.Mappublic int hashCode()
hashCode in interface java.util.Mappublic java.util.List valuesList()
Note, this collection is not backed by the map. Adding or removing items from the returned collection will not affect the contents of the ArrayMap.
public ArrayMap copy()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||