|
juife v0.1a |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.juife.TaskQueue
public class TaskQueue
The TaskQueue
class represents a queue that holds tasks
which are executed in FIFO order.
Note that the tasks are removed from the queue before their execution.
Constructor Summary | |
---|---|
TaskQueue()
Creates a new instance of TaskQueue . |
|
TaskQueue(java.lang.String name)
Creates a new instance of TaskQueue with the specified name. |
|
TaskQueue(java.lang.String name,
Task... tasks)
Creates a new instance of TaskQueue with the
specified name and adds the specified tasks to the queue. |
|
TaskQueue(Task... tasks)
Creates a new instance of TaskQueue and adds the
specified tasks to the queue. |
Method Summary | |
---|---|
void |
add(Task task)
Adds the specified task to the queue. |
void |
addTaskQueueListener(TaskQueueListener l)
Registers the specified listener for receiving event messages. |
void |
cancel()
Stops the task queue and cancels the execution of all pending tasks. |
java.lang.String |
getName()
Gets the name of this task queue. |
int |
getPendingTaskCount()
Gets the number of pending tasks. |
Task[] |
getPendingTasks()
Gets a list of all tasks in the queue pending for execution. |
Task |
getRunningTask()
Gets the currently running task. |
boolean |
isCancelled()
Determines whether the task queue is cancelled. |
boolean |
isEmpty()
Determines whether the task queue is empty. |
boolean |
isIdle()
Determines whether the queue is in idle state. |
boolean |
isRunning()
Determines whether this task queue is running. |
boolean |
isStarted()
Determines whether this task queue has been started. |
boolean |
isStopped()
Determines whether this task queue is stopped. |
void |
removePendingTasks()
Removes all pending tasks. |
void |
removeTaskQueueListener(TaskQueueListener l)
Removes the specified listener. |
void |
start()
Starts the processing of tasks in the queue. |
void |
stop()
Stops the task queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TaskQueue()
TaskQueue
.
public TaskQueue(java.lang.String name)
TaskQueue
with the specified name.
name
- The name of this task queue.public TaskQueue(Task... tasks)
TaskQueue
and adds the
specified tasks to the queue.
tasks
- The tasks to be added.public TaskQueue(java.lang.String name, Task... tasks)
TaskQueue
with the
specified name and adds the specified tasks to the queue.
name
- The name of this task queue.tasks
- The tasks to be added.Method Detail |
---|
public java.lang.String getName()
public void add(Task task)
task
- The task to be added.
java.lang.IllegalStateException
- If the queue is not running.public void start()
java.lang.IllegalStateException
- If the queue is already running.public boolean isStarted()
true
even if the queue is not running.
true
if the task queue has been started,
false
otherwise.isRunning()
,
isStopped()
public void cancel()
removePendingTasks()
,
stop
public boolean isCancelled()
true
if the task queue is cancelled, false
otherwise.public void stop()
isIdle()
method to determine whether all tasks in the queue are processed.
cancel
public boolean isStopped()
true
if the task queue is stopped, false
otherwise.public boolean isRunning()
true
if the task queue is running, false
otherwise.public boolean isEmpty()
true
if the queue is empty, false
otherwise.isIdle()
,
getRunningTask()
public boolean isIdle()
true
if the queue is in idle state, false
otherwise.public int getPendingTaskCount()
public Task[] getPendingTasks()
public Task getRunningTask()
null
if there is no running task at this moment.public void removePendingTasks()
public void addTaskQueueListener(TaskQueueListener l)
l
- The TaskListener
to register.public void removeTaskQueueListener(TaskQueueListener l)
l
- The TaskQueueListener
to remove.
|
juife v0.1a |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2005 Grigor Iliev. All rights reserved. |