|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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| Method Summary | |
|---|---|
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. |
| Method Detail |
|---|
ITaskPlanner getTaskPlanner()
java.util.Vector getTasks()
boolean isEmpty()
void pause()
IRunnableTask put(IRunnableTask task)
IRunnableTask - taskvoid resume()
void setTaskPlanner(ITaskPlanner planner)
planner - IRunnableTask take()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||