|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgalois.runtime.wl.RandomPermutation<T>
T - the type of elements of the worklist@OnlyLeaf public class RandomPermutation<T>
Order elements according to a random permutation of initial elements. Elements are ordered randomly
with respect to each other. After this worklist is initialized, no additional
elements may be added to this worklist. If elements need to be added during
iteration, consider RandomOrder or ChunkedRandomOrder.
RandomOrder,
ChunkedRandomOrder| Constructor Summary | |
|---|---|
RandomPermutation(Maker<T> maker,
boolean needSize)
|
|
| 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 |
| Constructor Detail |
|---|
public RandomPermutation(Maker<T> maker,
boolean needSize)
| 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 void finishAddInitial()
Worklist
finishAddInitial in interface Worklist<T>public 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>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||