org.omegahat.Numerics.Optimizers
Class BackgroundTaskManager
java.lang.Object
|
+--org.omegahat.Environment.TaskManagement.TaskManager
|
+--org.omegahat.Numerics.Optimizers.BackgroundTaskManager
- All Implemented Interfaces:
- DistributedTaskConstants, java.util.EventListener, IterationListener, java.lang.Runnable
- public class BackgroundTaskManager
- extends TaskManager
- implements IterationListener
|
Field Summary |
protected java.util.Vector |
listeners
A collection of listeners interested in events. |
| Methods inherited from class org.omegahat.Environment.TaskManagement.TaskManager |
addListener, addTask, createQueue, getTask, getTask, isComplete, notify, notify, notify, removeListener, run, tasks, tasks, warn |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
listeners
protected java.util.Vector listeners
- A collection of listeners interested in events. The manager
will take each event and dispatch the methods to those.
BackgroundTaskManager
public BackgroundTaskManager()
BackgroundTaskManager
public BackgroundTaskManager(TaskQueue q)
dispatchTask
public java.lang.Object dispatchTask(Task t)
- Invoke the event() method of the task supplied as argument, and
inform all the listeners about the resulting event.
That is, for all the listeners registered with this task manager,
pass the event object from the task to the continueIteration method of the
listener.
- Overrides:
dispatchTask in class TaskManager
continueIteration
public boolean continueIteration(IterationEvent ev)
- Specified by:
continueIteration in interface IterationListener
addListener
public int addListener(IterationListener l)
- Add the listener to the vector of listeners.
Returns the size of the set of listeners.
removeListener
public void removeListener(IterationListener l)
- Remove this listener from the vector of listeners.
listeners
public java.util.Vector listeners()
- Get the vector of listeners.
- Overrides:
listeners in class TaskManager
listeners
public java.util.Vector listeners(java.util.Vector v)
- Set the vector of listeners.
- Overrides:
listeners in class TaskManager