public class TaskQueue extends java.lang.Object implements TaskQueueInterface
Deque
interfaceTaskQueueInterface
Constructor and Description |
---|
TaskQueue()
Construct a TaskQueue
|
Modifier and Type | Method and Description |
---|---|
void |
addTask(TaskInterface task)
Add a task to the queue
|
int |
count()
Count the number of elements contained in the queue
|
TaskInterface |
getTask()
Get the oldest task in the queue
|
boolean |
isEmpty()
Return true if the queue is empty
|
void |
removeTask(TaskInterface task)
Remove a task from the queue.
|
public void addTask(TaskInterface task)
addTask
in interface TaskQueueInterface
task
- the object TaskInterface to add in the queuepublic TaskInterface getTask()
getTask
in interface TaskQueueInterface
public void removeTask(TaskInterface task)
removeTask
in interface TaskQueueInterface
task
- the object task to remove from the queuepublic boolean isEmpty()
isEmpty
in interface TaskQueueInterface
public int count()
count
in interface TaskQueueInterface