public class TaskUtils extends Object
Helper class which provides useful operations with tasks.
Constructor and Description |
---|
TaskUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
apply(Task root,
ITreeAlgorithm<Task> alg,
int level)
Applies specified algorithm to each task of a tree.
|
static Task |
filter(Task root,
ICondition<Task> cond)
Builds new tree of tasks which satisfy the condition.
|
static Task |
find(Task root,
ICondition<Task> cond)
Finds a task which satisfy the condition in a tree of tasks.
|
static int |
taskChildrenCount(Task task)
Recursively calculates a number of task's children tasks through all levels.
|
public static void apply(Task root, ITreeAlgorithm<Task> alg, int level)
Applies specified algorithm to each task of a tree.
root
- Root of the treealg
- Applied algorithm.level
- Level of the root task.public static Task filter(Task root, ICondition<Task> cond)
Builds new tree of tasks which satisfy the condition.
root
- Root of the tree.cond
- Applied condition.public static Task find(Task root, ICondition<Task> cond)
Finds a task which satisfy the condition in a tree of tasks.
root
- Root of the tree.cond
- Applied condition.public static int taskChildrenCount(Task task)
Recursively calculates a number of task's children tasks through all levels.
task
- The task which children calculate.