|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpivot.util.concurrent.Task<Void>
pivot.util.concurrent.TaskGroup<V>
public class TaskGroup<V>
Class that runs a group of tasks in parallel and notifies listeners
when all tasks are complete. Callers can retrieve task results or faults by
calling Task.getResult()
and Task.getFault()
,
respectively.
Field Summary |
---|
Fields inherited from class pivot.util.concurrent.Task |
---|
abort, timeout |
Constructor Summary | |
---|---|
TaskGroup()
|
|
TaskGroup(Dispatcher dispatcher)
|
Method Summary | |
---|---|
void |
add(Task<V> element)
Adds an element to the group. |
boolean |
contains(Task<V> element)
Tests the existence of an element in the group. |
Void |
execute()
Synchronously executes the task. |
boolean |
isEmpty()
Tests the emptiness of the group. |
Iterator<Task<V>> |
iterator()
|
void |
remove(Task<V> element)
Removes an element from the group. |
Methods inherited from class pivot.util.concurrent.Task |
---|
abort, execute, getDispatcher, 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(Dispatcher dispatcher)
Method Detail |
---|
public Void execute() throws TaskExecutionException
Task
execute
in class Task<Void>
TaskExecutionException
- If an error occurs while executing the task.public void add(Task<V> element)
Group
add
in interface Group<Task<V>>
element
- The element to add to the group.public void remove(Task<V> element)
Group
remove
in interface Group<Task<V>>
element
- The element to remove from the set.public boolean contains(Task<V> element)
Group
contains
in interface Group<Task<V>>
element
- The element whose presence in the group is to be tested.
public boolean isEmpty()
Group
isEmpty
in interface Group<Task<V>>
public Iterator<Task<V>> iterator()
iterator
in interface Iterable<Task<V>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |