LinkedHashSet instead.public class WorkSet<E>
extends java.util.AbstractSet<E>
implements java.io.Serializable
WorkSet is a Set offering constant-time
access to the first/last element inserted, and an iterator whose speed
is not dependent on the total capacity of the underlying hashtable.
Conforms to the JDK 1.2 Collections API.
| Constructor and Description |
|---|
WorkSet()
Deprecated.
Creates a new, empty
WorkSet with a default capacity
and load factor. |
WorkSet(java.util.Collection<? extends E> c)
Deprecated.
Constructs a new
WorkSet with the contents of the
specified Collection. |
WorkSet(int initialCapacity)
Deprecated.
Constructs a new, empty
WorkSet with the specified
initial capacity and default load factor. |
WorkSet(int initialCapacity,
float loadFactor)
Deprecated.
Constructs a new, empty
WorkSet with the specified
initial capacity and the specified load factor. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o)
Deprecated.
Adds the object to the set and returns true if the element
is not already present.
|
boolean |
addFirst(E o)
Deprecated.
Adds an element to the front of the (ordered) set and returns true,
if the element is not already present in the set.
|
boolean |
addLast(E o)
Deprecated.
Adds an element to the end of the (ordered) set and returns true,
if the element is not already present in the set.
|
void |
clear()
Deprecated.
Removes all elements from the set.
|
boolean |
contains(java.lang.Object o)
Deprecated.
Determines if this contains an item.
|
E |
getFirst()
Deprecated.
Returns the first element in the ordered set.
|
E |
getLast()
Deprecated.
Returns the last element in the ordered set.
|
boolean |
isEmpty()
Deprecated.
Determines if there are any more items left in this.
|
java.util.Iterator<E> |
iterator()
Deprecated.
Efficient set iterator.
|
E |
peek()
Deprecated.
Looks at the object as the top of this
WorkSet
(treating it as a Stack) without removing it
from the set/stack. |
E |
pop()
Deprecated.
Removes the item at the top of this
WorkSet
(treating it as a Stack) and returns that object
as the value of this function. |
void |
push(E item)
Deprecated.
Pushes item onto the top of this
WorkSet (treating
it as a Stack), if it is not already there. |
boolean |
remove(java.lang.Object o)
Deprecated.
|
E |
removeFirst()
Deprecated.
Removes the first element in the ordered set and returns it.
|
E |
removeLast()
Deprecated.
Removes the last element in the ordered set and returns it.
|
int |
size()
Deprecated.
|
addAll, containsAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic WorkSet()
WorkSet with a default capacity
and load factor.public WorkSet(int initialCapacity)
WorkSet with the specified
initial capacity and default load factor.public WorkSet(int initialCapacity,
float loadFactor)
WorkSet with the specified
initial capacity and the specified load factor.public boolean addFirst(E o)
public boolean addLast(E o)
public E getFirst()
public E getLast()
public E removeFirst()
public E removeLast()
public E peek()
WorkSet
(treating it as a Stack) without removing it
from the set/stack.public E pop()
WorkSet
(treating it as a Stack) and returns that object
as the value of this function.public void push(E item)
WorkSet (treating
it as a Stack), if it is not already there.
If the item is already in the set/on the stack,
then this method does nothing.
this
item is not already an
element of this, adds
item to this.
Else does nothing.public boolean add(E o)
public void clear()
public boolean contains(java.lang.Object o)
o is an element of
this, returns true.
Else returns false.public boolean isEmpty()
this has any elements,
returns true. Else returns false.public java.util.Iterator<E> iterator()
public boolean remove(java.lang.Object o)
Copyright (c) 2006 C. Scott Ananian