|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgalois.runtime.wl.ChunkedFIFO<T>
T - the type of elements of the worklistpublic class ChunkedFIFO<T>
Order elements in chunks of size N, full chunks are ordered in FIFO order. Partial chunks are unordered with respect to each other. Elements are unordered within a chunk and are eligible to be ordered by subsequent rules.
ChunkedLIFO,
FIFO| Field Summary | |
|---|---|
static int |
DEFAULT_CHUNK_SIZE
|
| Constructor Summary | |
|---|---|
ChunkedFIFO(int chunkSize,
Maker<T> maker,
boolean needSize)
Creates a chunked FIFO order with the given chunk size |
|
ChunkedFIFO(Maker<T> maker,
boolean needSize)
Creates a chunked FIFO order with the default chunk size (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_CHUNK_SIZE
| Constructor Detail |
|---|
public ChunkedFIFO(Maker<T> maker,
boolean needSize)
public ChunkedFIFO(int chunkSize,
Maker<T> maker,
boolean needSize)
chunkSize - chunk size to use| 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 boolean isEmpty()
WorklistWorklist.poll(ForeachContext) return
null.
isEmpty in interface Worklist<T>public int size()
size 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 | ||||||||