java.lang.Objectjavax.baja.nre.util.OrderedHashMap
OrderedHashMap is a replacement for java.util.LinkedHashMap. See the documentation for LinkedHashMap for a detailed explanation of how OrderedHashMap works.
OrderedHashMap has exactly the same semantics as LinkedHashMap, with the following exceptions:
| Nested Class Summary | |
static interface |
OrderedHashMap.Entry
A map entry (key-value pair). |
| Constructor Summary | |
OrderedHashMap()
Constructs an empty insertion-ordered map. |
|
OrderedHashMap(boolean accessOrder)
Constructs an empty map with the specified ordering mode. |
|
OrderedHashMap(int initialCapacity,
float loadFactor,
boolean accessOrder)
Constructs an empty OrderedHashMap instance with the specified initial capacity, load factor and ordering mode. |
|
OrderedHashMap(java.util.Map m)
Constructs an insertion-ordered OrderedHashMap instance with the same mappings as the specified map. |
|
| Method Summary | |
void |
clear()
Removes all mappings from this map. |
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set |
entrySet()
|
java.lang.Object |
get(java.lang.Object key)
|
OrderedHashMap.Entry |
getEldestEntry()
Get the eldest entry. |
OrderedHashMap.Entry |
getNewestEntry()
Get the newest entry. |
boolean |
isEmpty()
|
java.util.Set |
keySet()
|
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 t)
Copies all of the mappings from the specified map to this map. |
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for this key from this map if it is present. |
protected boolean |
removeEldestEntry()
|
int |
size()
|
java.lang.String |
toString()
|
java.util.Collection |
values()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
equals, hashCode |
| Constructor Detail |
public OrderedHashMap()
public OrderedHashMap(boolean accessOrder)
accessOrder - the ordering mode - true for
access-order, false for insertion-order.
public OrderedHashMap(int initialCapacity,
float loadFactor,
boolean accessOrder)
initialCapacity - the initial capacity.loadFactor - the load factor.accessOrder - the ordering mode - true for
access-order, false for insertion-order.
java.lang.IllegalArgumentException - if the initial capacity is negative
or the load factor is nonpositive.public OrderedHashMap(java.util.Map m)
m - the map whose mappings are to be placed in this map.
java.lang.NullPointerException - if the specified map is null.| 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.Mappublic void putAll(java.util.Map t)
putAll in interface java.util.Mappublic OrderedHashMap.Entry getEldestEntry()
java.util.NoSuchElementException - if the map is empty.public OrderedHashMap.Entry getNewestEntry()
java.util.NoSuchElementException - if the map is empty.protected boolean removeEldestEntry()
public java.lang.Object get(java.lang.Object key)
get in interface java.util.Map
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mappublic java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mappublic void clear()
clear in interface java.util.Mappublic boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Mappublic java.util.Set keySet()
keySet in interface java.util.Mappublic java.util.Collection values()
values in interface java.util.Mappublic java.util.Set entrySet()
entrySet in interface java.util.Mappublic java.lang.String toString()
Copyright © 2000-2016 Tridium Inc. All rights reserved.