LinkedHashSet instead.public class WorkSet<E> extends AbstractSet<E> implements 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(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(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.
|
Iterator<E> |
iterator()
Deprecated.
Efficient set iterator.
|
E |
peek()
Deprecated.
|
E |
pop()
Deprecated.
|
void |
push(E item)
Deprecated.
|
boolean |
remove(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.
|
equals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, containsAll, retainAll, spliterator, toArray, toArrayparallelStream, removeIf, streampublic 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 WorkSet(Collection<? extends E> c)
WorkSet with the contents of the
specified Collection.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()
public E pop()
public void push(E item)
public boolean add(E o)
add in interface Collection<E>add in interface Set<E>add in class AbstractCollection<E>public void clear()
clear in interface Collection<E>clear in interface Set<E>clear in class AbstractCollection<E>public boolean contains(Object o)
o is an element of
this, returns true.
Else returns false.contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>public boolean isEmpty()
this has any elements,
returns true. Else returns false.isEmpty in interface Collection<E>isEmpty in interface Set<E>isEmpty in class AbstractCollection<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>public int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>Copyright (c) 2006 C. Scott Ananian