public interface IQueue
You should write your own concrete Queue implementation to hold the tasks in
a specific kind of queue.
Following the contract, you should also write a task planner that does what
you desire. Task planners are a concrete class of the ITaskPlanner that would
plannify which is the next, the previous,.. task to be done. However, if
you don't want to write anything special, just guess a simple FIFO queue
ITaskPlanner
Modifier and Type | Method and Description |
---|---|
ITaskPlanner |
getTaskPlanner()
Returns the task planner currently defined by this queue.
|
java.util.Vector |
getTasks()
Returns the set of tasks in a Vector (thread-safe).
|
boolean |
isEmpty()
Returns true if the Queue has no (more) jobs to do.
|
void |
pause()
Causes the execution of this queue to be paused.
|
IRunnableTask |
put(IRunnableTask task)
Adds a new task to the queue.
|
void |
resume()
Causes the execution of this queue to be resumed.
|
void |
setTaskPlanner(ITaskPlanner planner)
Sets the TaskPlanner that will decide which of the tasks in the queue will
be executed next.
|
IRunnableTask |
take()
Returns the next task by calling the task planner's nextTask() method.
|
IRunnableTask put(IRunnableTask task)
IRunnableTask
- taskIRunnableTask take()
boolean isEmpty()
ITaskPlanner getTaskPlanner()
void setTaskPlanner(ITaskPlanner planner)
planner
- void pause()
void resume()
java.util.Vector getTasks()