|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractMap
ariba.util.core.Hashtable
ariba.util.core.OrderedHashtable
public class OrderedHashtable
An OrderedHashtable is just like a normal Hashtable except that it remembers the order the keys were added to the table and, whenever keys() or elements() is called, they are returned in that order.
Just overrides all the appropriate methods in Hashtable.
Adds only one method reverseKeys(), which is the same as keys(), but the
Enumeration is in the reverse order.
Note:: Because this an ordered collection, its performances maybe not be as good as an ordinary Hashtable. Use it only when the order of entry matters
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
OrderedHashtable()
|
|
| Method Summary | |
|---|---|
void |
clear()
Removes all keys and elements from the Hashtable. |
Object |
clone()
Creates a shallow copy of the OrderedHashtable. |
Enumeration |
elements()
Returns an Enumeration of the Hashtable's elements. |
int |
indexOfKey(Object key)
|
void |
insertElementAt(Object key,
Object value,
int index)
|
Enumeration |
keys()
Returns an Enumeration of the Hashtable's keys. |
Set |
keySet()
Returns a Set view of the keys contained in this map. |
Object |
put(Object key,
Object value)
Places the key/element pair in the Hashtable. |
Object |
remove(Object key)
Finds and removes key and the element associated with it from the Hashtable. |
int |
removeElement(Object element)
Finds and removes all occurrences of element from the Hashtable. |
Object |
removeElementAt(int index)
|
Enumeration |
reverseKeys()
|
void |
setElementAt(Object key,
Object value,
int index)
Set the element which is the key/value pair in this OrderedHashtable at a given index. |
Collection |
values()
Returns a collection view of the values contained in this map. |
| Methods inherited from class ariba.util.core.Hashtable |
|---|
contains, containsKey, count, elementsArray, elementsVector, entrySet, fromSerializedString, get, isEmpty, keysArray, keysVector, readExternal, size, toSerializedString, toString, toStringArray, writeExternal |
| Methods inherited from class java.util.AbstractMap |
|---|
containsValue, equals, hashCode, putAll |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OrderedHashtable()
| Method Detail |
|---|
public Object put(Object key,
Object value)
Hashtable
put in interface Mapput in class Hashtablekey - the key to place into the Hashtable; may not be
nullvalue - the element to place into the Hashtable; may
not be null
public void clear()
Hashtable
clear in interface Mapclear in class Hashtablepublic Object remove(Object key)
Hashtable
remove in interface Mapremove in class Hashtablekey - the key to search the hashtable's keys
for. Hashtable hashes and compares key using
hashCode() and equals().
public int removeElement(Object element)
Hashtable
removeElement in class Hashtableelement - the element to search for. Hashtable compares elements
using equals().
MapUtil.removeElement(java.util.Map, java.lang.Object)public Enumeration keys()
Hashtable
keys in class HashtableHashtable.keySet,
Set.iterator(),
Hashtable.elements()public Enumeration elements()
Hashtable
elements in class HashtableHashtable.values,
Collection.iterator(),
Hashtable.keys()public Object clone()
clone in class HashtableInternalError - if the cloning operation fails.public Set keySet()
keySet in interface MapkeySet in class Hashtablepublic Collection values()
values in interface Mapvalues in class Hashtablepublic Enumeration reverseKeys()
public void insertElementAt(Object key,
Object value,
int index)
public void setElementAt(Object key,
Object value,
int index)
key - the key to be setvalue - the value associated with keyindex - the order of this key-value pairpublic Object removeElementAt(int index)
public int indexOfKey(Object key)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||