|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WorkSet<T>
WorkSet
is an ordered set-like data structure. In the
current implementations, the order the elements are extracted from
a WorkSet
has some relation to the order the elements
were inserted or to the elements' priorities. This data structure
is useful for fixed point computations. In all the current
WorkSet
implementations the
add
/extract
operations have O(1)
complexity, except WorkPriorityQueue
where they are
logarithmic.
Method Summary | |
---|---|
boolean |
add(T elem)
Adds the element elem to this
workset. |
boolean |
addAll(java.util.Collection<T> elems)
Adds all elements from elems to this
workset. |
void |
clear()
Removes all elements from the workset. Complexity: O(1). |
boolean |
contains(T e)
Checks whether this workset contains the element
e .Complexity: O(1). |
T |
extract()
Returns the first element of this workset
(according to the order specific to this workset. |
boolean |
isEmpty()
Checks whether this workset is empty.Complexity: O(1). |
int |
size()
Returns the size of this workset.Invariant: isEmpty() iff size() ==
0 .Complexity: O(1). |
Method Detail |
---|
boolean add(T elem)
elem
to this
workset.
true
if elem
was not already
in the workset. If elem
was already in the
workset, the workset does not change in any way, and
add
returns false
.boolean addAll(java.util.Collection<T> elems)
elems
to this
workset.
true
if any of the added elements was not
already in this
workset. Otherwise, the workset
does not change in any way, and add
returns
false
.T extract()
this
workset
(according to the order specific to this
workset.
The element is removed from the workset. Throws a NoSuchElementException
if
the workset is empty.
void clear()
boolean isEmpty()
this
workset is empty.
boolean contains(T e)
this
workset contains the element
e
.
int size()
this
workset.isEmpty()
iff size() ==
0
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |