public class OrderedHashSet<T>
extends java.util.HashSet
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<T> |
elements
Track the elements as they are added to the set
|
| Constructor and Description |
|---|
OrderedHashSet() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(java.lang.Object value)
Add a value to list; keep in hashtable for consistency also;
Key is object itself.
|
void |
clear() |
java.util.List<T> |
elements()
Return the List holding list of table elements.
|
T |
get(int i) |
boolean |
remove(java.lang.Object o) |
T |
set(int i,
T value)
Replace an existing value with a new value; updates the element
list and the hash table, but not the key as that has not changed.
|
int |
size() |
java.lang.String |
toString() |
addAll, containsAll, retainAll, toArray, toArrayprotected java.util.List<T> elements
public T get(int i)
public T set(int i, T value)
public boolean add(java.lang.Object value)
add in interface java.util.Collectionadd in interface java.util.Setadd in class java.util.HashSetpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Setremove in class java.util.HashSetpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Setclear in class java.util.HashSetpublic java.util.List<T> elements()
public int size()
size in interface java.util.Collectionsize in interface java.util.Setsize in class java.util.HashSetpublic java.lang.String toString()
toString in class java.util.AbstractCollectionCopyright © 2012. All Rights Reserved.