|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.grogra.task.Solver
de.grogra.task.SolverInOwnThread
public abstract class SolverInOwnThread
This abstract class implements Solver
such that a thread
is created in which the actual work is done.
Constructor Summary | |
---|---|
SolverInOwnThread()
|
Method Summary | |
---|---|
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. |
Methods inherited from class de.grogra.task.Solver |
---|
getCurrentPartialTask, getTask, initialize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SolverInOwnThread()
Method Detail |
---|
protected 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()
Solver
Task
when this solver
is removed from the task. Subclasses have to implement this method
in order to free resources (e.g., created threads).
dispose
in class Solver
public void run()
run
in interface java.lang.Runnable
protected void solve()
Solver
Task.partialTaskDone(Solver)
has to be invoked.
solve
in class Solver
protected abstract void solveImpl(PartialTask task)
task
- task to solve
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |