|
JUtil | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractSet<E> net.cscott.jutil.WorkSet<E>
LinkedHashSet
instead.
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()
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. |
Method Summary | |
---|---|
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. 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(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. |
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 java.util.Set |
---|
addAll, containsAll, retainAll, toArray, toArray |
Constructor Detail |
---|
public 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
.
Method Detail |
---|
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)
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 Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in interface Set<E>
iterator
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>
|
JUtil | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |