|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
net.cscott.jutil.WorkSet<E>
harpoon.Util.Collections.WorkSet<E>
public class WorkSet<E>
A 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 Summary | |
---|---|
WorkSet()
|
|
WorkSet(Collection<? extends E> c)
Constructs a new WorkSet with the contents of the
specified Collection . |
|
WorkSet(int initialCapacity)
Constructs a new, empty WorkSet with the specified
initial capacity and default load factor. |
|
WorkSet(int initialCapacity,
float loadFactor)
Constructs a new, empty WorkSet with the specified
initial capacity and the specified load factor. |
Method Summary | |
---|---|
E |
peek()
Looks at the object as the top of this WorkSet
(treating it as a Stack ) without removing it
from the set/stack. |
E |
pop()
Removes the item at the top of this WorkSet
(treating it as a Stack ) and returns that object
as the value of this function. |
E |
pull()
Removes some item from this and return it (Worklist adaptor method). |
void |
push(E item)
Pushes item onto the top of this WorkSet (treating
it as a Stack ), if it is not already there. |
Methods inherited from class net.cscott.jutil.WorkSet |
---|
add, addFirst, addLast, clear, contains, getFirst, getLast, isEmpty, iterator, remove, removeFirst, removeLast, size |
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, containsAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface harpoon.Util.Worklist |
---|
contains, isEmpty |
Methods inherited from interface java.util.Set |
---|
addAll, containsAll, retainAll, toArray, toArray |
Constructor Detail |
---|
public WorkSet()
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
.
Method Detail |
---|
public E peek()
WorkSet
(treating it as a Stack
) without removing it
from the set/stack.
peek
in class WorkSet<E>
public E pull()
this
Object
,
item
, that is an element of
this
, removes
item
from this
and returns item
. Else does
nothing.
pull
in interface Worklist<E>
public E pop()
WorkSet
(treating it as a Stack
) and returns that object
as the value of this function.
pop
in class WorkSet<E>
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.
push
in interface Worklist<E>
push
in class WorkSet<E>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |