de.grogra.task
public abstract class SolverInOwnThread extends Solver implements java.lang.Runnable
Solver such that a thread
is created in which the actual work is done.| Constructor and Description |
|---|
SolverInOwnThread() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.lang.Thread |
createThread()
Create the thread to use.
|
void |
dispose()
This method is invoked by the
Task when this solver
is removed from the task. |
void |
run() |
protected void |
solve()
This method has to be implemented by subclasses in order to
solve the current partial task synchronously or asynchronously.
|
protected abstract void |
solveImpl(PartialTask task)
This method has to be implemented to perform the actual work.
|
getCurrentPartialTask, getTask, initializeprotected abstract java.lang.Thread createThread()
null,
the solve methods operates synchronously, i.e.,
it immediately solves the partial task.null
in synchronous casepublic void dispose()
SolverTask when this solver
is removed from the task. Subclasses have to implement this method
in order to free resources (e.g., created threads).public void run()
run in interface java.lang.Runnableprotected void solve()
SolverTask.partialTaskDone(Solver) has to be invoked.protected abstract void solveImpl(PartialTask task)
task - task to solve