|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<K,V>
com.sibvisions.util.OrderedHashtable<K,V>
K - the key object typeV - the value object typepublic class OrderedHashtable<K,V>
The OrderedHashtable extends a Hashtable and keeps
the add order. It works according to the FiFo principle. The first key
added is the first key in the key list.
Hashtable,
Serialized Form| Constructor Summary | |
|---|---|
OrderedHashtable()
Creates a new instance of OrderedHashtable with a default
initial capacity (11) and load factor (0.75). |
|
OrderedHashtable(int pCapacity)
Creates a new instance of OrderedHashtable with the specified initial
capacity and default load factor (0.75). |
|
OrderedHashtable(int pCapacity,
float pLoadFactor)
Creates a new instance of OrderedHashtable with the specified initial
capacity and the specified load factor. |
|
OrderedHashtable(java.util.Map<? extends K,? extends V> pMap)
Creates a new instance of OrderedHashtable with the same mappings
as the given Map. |
|
| Method Summary | |
|---|---|
void |
clear()
|
java.lang.Object |
clone()
Creates a shallow copy of this hashtable. |
K |
getKey(int pIndex)
Gets a key by index. |
java.util.Enumeration<K> |
keys()
Returns an enumeration of the keys in this hashtable. |
V |
put(K pKey,
V pValue)
Maps the specified pKey to the specified
pValue in this hashtable. |
V |
remove(java.lang.Object pKey)
Removes the key (and its corresponding value) from this hashtable. |
| Methods inherited from class java.util.Hashtable |
|---|
contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, rehash, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OrderedHashtable()
OrderedHashtable with a default
initial capacity (11) and load factor (0.75).
Hashtable.Hashtable()public OrderedHashtable(int pCapacity)
OrderedHashtable with the specified initial
capacity and default load factor (0.75).
pCapacity - the initial capacity of the hashtable
java.lang.IllegalArgumentException - if the initial capacity is less than zeroHashtable.Hashtable(int)
public OrderedHashtable(int pCapacity,
float pLoadFactor)
OrderedHashtable with the specified initial
capacity and the specified load factor.
pCapacity - the initial capacity of the hashtablepLoadFactor - the load factor of the hashtable
java.lang.IllegalArgumentException - if the initial capacity is less than zero,
or if the load factor is nonpositive.Hashtable.Hashtable(int, float)public OrderedHashtable(java.util.Map<? extends K,? extends V> pMap)
OrderedHashtable with the same mappings
as the given Map. The hashtable is created with an initial capacity sufficient
to hold the mappings in the given Map and a default load factor (0.75).
pMap - the map whose mappings are to be placed in this map.
java.lang.NullPointerException - if the specified map is null.| Method Detail |
|---|
public V put(K pKey,
V pValue)
pKey to the specified
pValue in this hashtable. Neither the key nor the
value can be null.
The value can be retrieved by calling the get method
with a key that is equal to the original key.
The order will be stored to guarantee the FiFo principle.
put in interface java.util.Map<K,V>put in class java.util.Hashtable<K,V>pKey - the hashtable keypValue - the value
null if it did not have one
java.lang.NullPointerException - if the key or value is nullHashtable.get(Object)public V remove(java.lang.Object pKey)
remove in interface java.util.Map<K,V>remove in class java.util.Hashtable<K,V>pKey - the key that needs to be removed
null if the key did not have a mapping
java.lang.NullPointerException - if the key is nullpublic java.lang.Object clone()
clone in class java.util.Hashtable<K,V>public void clear()
clear in interface java.util.Map<K,V>clear in class java.util.Hashtable<K,V>public java.util.Enumeration<K> keys()
keys in class java.util.Hashtable<K,V>public K getKey(int pIndex)
pIndex - the index of the key
java.lang.ArrayIndexOutOfBoundsException - if the index is out of range
(index < 0 || index >= size())
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||