de.grogra.task
public abstract class Solver extends java.lang.Object
Solver solves a PartialTask
of a Task. The process of solving may
be implemented asynchronously, so that multiple processors
or even remote processors can be used.| Constructor and Description |
|---|
Solver() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
dispose()
This method is invoked by the
Task when this solver
is removed from the task. |
PartialTask |
getCurrentPartialTask()
Returns the partial task which is currently solved by this
solver.
|
Task |
getTask()
Returns the complete task for which this solver is used.
|
void |
initialize(Task task)
Initializes this solver to be used for the given task.
|
protected abstract void |
solve()
This method has to be implemented by subclasses in order to
solve the current partial task synchronously or asynchronously.
|
public abstract void dispose()
Task when this solver
is removed from the task. Subclasses have to implement this method
in order to free resources (e.g., created threads).public final PartialTask getCurrentPartialTask()
null if the solver has nothing
to do.public Task getTask()
public void initialize(Task task)
task - the complete task for which this solver is usedprotected abstract void solve()
Task.partialTaskDone(Solver) has to be invoked.