|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpolyglot.util.WorkList
public class WorkList
This class represents a set of calculations to be performed, some of which have already been completed. It optionally stores the results of those calculations. Requires: every 'calculation' object has a working hashcode and toString method.
Field Summary | |
---|---|
static java.lang.Object |
NOT_CALCULATED
|
Constructor Summary | |
---|---|
WorkList()
Creates a new, empty worklist. |
Method Summary | |
---|---|
void |
addWork(java.util.Collection c)
Adds every member of the collection |
void |
addWork(java.lang.Object o)
Adds the calculation represented by |
boolean |
finished()
Returns true iff there is no more work to do. |
void |
finishWork(java.lang.Object work)
Announces that we have finished the calculation represented by |
void |
finishWork(java.lang.Object work,
java.lang.Object result)
Announces that we have finished the calculation represented by |
java.util.Map |
getMap()
Returns an immutable view of a map from calculation objects to their results. |
java.lang.Object |
getWork()
Returns the first element with no known result. |
boolean |
isFinished(java.lang.Object work)
Returns true iff |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Object NOT_CALCULATED
Constructor Detail |
---|
public WorkList()
Method Detail |
---|
public void addWork(java.lang.Object o)
public void addWork(java.util.Collection c)
public boolean finished()
public java.lang.Object getWork()
public void finishWork(java.lang.Object work, java.lang.Object result)
public void finishWork(java.lang.Object work)
public boolean isFinished(java.lang.Object work)
public java.util.Map getMap()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |