|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgalois.runtime.wl.BoundedLIFO<T>
T - the type of elements of the worklist@OnlyLeaf public class BoundedLIFO<T>
Order elements in last-in-first-order order, i.e., stack order. This order may only contain up to N elements.
LIFO| Field Summary | |
|---|---|
static int |
DEFAULT_MAX_ELEMENTS
|
| Constructor Summary | |
|---|---|
BoundedLIFO(int maxElements,
Maker<T> maker,
boolean needSize)
Creates a bounded LIFO order with the given maximum number of elements |
|
BoundedLIFO(Maker<T> maker,
boolean needSize)
Creates a bounded LIFO order with the default maximum number of elements (32) |
|
| Method Summary | |
|---|---|
void |
add(T item,
ForeachContext<T> ctx)
Adds an element to this worklist. |
void |
addInitial(T item,
ForeachContext<T> ctx)
Adds an element to this worklist. |
void |
finishAddInitial()
Marks when no more elements will be added from the initial elements passed to an executor. |
boolean |
isEmpty()
Checks for emptiness. |
Worklist<T> |
newInstance()
|
T |
poll(ForeachContext<T> ctx)
Removes an element from this worklist. |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MAX_ELEMENTS
| Constructor Detail |
|---|
public BoundedLIFO(Maker<T> maker,
boolean needSize)
public BoundedLIFO(int maxElements,
Maker<T> maker,
boolean needSize)
maxElements - the maximum number of elements| Method Detail |
|---|
public Worklist<T> newInstance()
newInstance in interface Worklist<T>
public void add(T item,
ForeachContext<T> ctx)
Worklist
add in interface Worklist<T>item - the item to addctx - an executor context
public void addInitial(T item,
ForeachContext<T> ctx)
Worklist
addInitial in interface Worklist<T>item - the item to addctx - an executor contextpublic T poll(ForeachContext<T> ctx)
Worklist
poll in interface Worklist<T>ctx - an executor context
null if there are no more elements in this
worklistpublic int size()
size in interface Worklist<T>public boolean isEmpty()
WorklistWorklist.poll(ForeachContext) return
null.
isEmpty in interface Worklist<T>public void finishAddInitial()
Worklist
finishAddInitial in interface Worklist<T>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||