galois.runtime.wl
Interface OrderableWorklist<T>

Type Parameters:
T - the type of elements of the worklist
All Superinterfaces:
Worklist<T>
All Known Implementing Classes:
Ordered

public interface OrderableWorklist<T>
extends Worklist<T>

Worklists that can be used for ordered Galois iterators


Method Summary
 void add(T item, ForeachContext<T> ctx)
          Adds an element to this worklist.
 Comparator<T> getComparator()
           
 boolean isEmpty()
          Checks for emptiness.
 T peek()
           
 T poll(ForeachContext<T> ctx)
          Removes an element from this worklist.
 int size()
           
 
Methods inherited from interface galois.runtime.wl.Worklist
addInitial, finishAddInitial, newInstance
 

Method Detail

add

void add(T item,
         ForeachContext<T> ctx)
Description copied from interface: Worklist
Adds an element to this worklist. This method is used for newly generated elements or elements added during Galois execution. Thread-safe.

Specified by:
add in interface Worklist<T>
Parameters:
item - the item to add
ctx - an executor context

poll

T poll(ForeachContext<T> ctx)
Description copied from interface: Worklist
Removes an element from this worklist. Thread-safe.

Specified by:
poll in interface Worklist<T>
Parameters:
ctx - an executor context
Returns:
an element or null if there are no more elements in this worklist

isEmpty

boolean isEmpty()
Description copied from interface: Worklist
Checks for emptiness. Only called by one thread at a time so does not have to be thread-safe. Also, can assume that all threads have had Worklist.poll(ForeachContext) return null.

Specified by:
isEmpty in interface Worklist<T>
Returns:
true if there are no more elements in this worklist

size

int size()
Specified by:
size in interface Worklist<T>
Returns:
the number of elements in this worklist, during concurrent execution this may be a lower bound on the number of elements

getComparator

Comparator<T> getComparator()

peek

T peek()