|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.util.concurrent.Task<Void>
org.apache.pivot.util.concurrent.TaskGroup
public class TaskGroup
Task
that runs a group of tasks in parallel and notifies listeners
when all tasks are complete.
Field Summary |
---|
Fields inherited from class org.apache.pivot.util.concurrent.Task |
---|
abort, DEFAULT_EXECUTOR_SERVICE, timeout |
Constructor Summary | |
---|---|
TaskGroup()
|
|
TaskGroup(ExecutorService executorService)
|
Method Summary | |
---|---|
void |
abort()
Aborts all tasks in this group. |
boolean |
add(Task<?> element)
Adds an element to the group. |
boolean |
contains(Task<?> element)
Tests the existence of an element in the group. |
Void |
execute()
Synchronously executes the task. |
int |
getCount()
|
Iterator<Task<?>> |
iterator()
|
boolean |
remove(Task<?> element)
Removes an element from the group. |
Methods inherited from class org.apache.pivot.util.concurrent.Task |
---|
execute, execute, getExecutorService, getFault, getResult, getTimeout, isPending, setTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TaskGroup()
public TaskGroup(ExecutorService executorService)
Method Detail |
---|
public Void execute() throws TaskExecutionException
Task
execute
in class Task<Void>
TaskExecutionException
- If an error occurs while executing the task.public void abort()
abort
in class Task<Void>
public boolean add(Task<?> element)
Group
add
in interface Group<Task<?>>
element
- The element to add to the group.
public boolean remove(Task<?> element)
Group
remove
in interface Group<Task<?>>
element
- The element to remove from the set.
public boolean contains(Task<?> element)
Group
contains
in interface Group<Task<?>>
element
- The element whose presence in the group is to be tested.
public int getCount()
public Iterator<Task<?>> iterator()
iterator
in interface Iterable<Task<?>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |