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, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
protected 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.Collection
add
in interface java.util.Set
add
in class java.util.HashSet
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.Set
remove
in class java.util.HashSet
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.Set
clear
in class java.util.HashSet
public java.util.List<T> elements()
public int size()
size
in interface java.util.Collection
size
in interface java.util.Set
size
in class java.util.HashSet
public java.lang.String toString()
toString
in class java.util.AbstractCollection