TaskUtils
Contents
[
Hide
]Inheritance: java.lang.Object
public class TaskUtils
Helper class which provides useful operations with tasks.
Constructors
Constructor | Description |
---|---|
TaskUtils() |
Methods
Method | Description |
---|---|
apply(Task root, ITreeAlgorithm<Task> alg, int level) | Applies specified algorithm to each task of a tree. |
filter(Task root, ICondition<Task> cond) | Builds new tree of tasks which satisfy the condition. |
find(Task root, ICondition<Task> cond) | Finds a task which satisfy the condition in a tree of tasks. |
taskChildrenCount(Task task) | Recursively calculates a number of task’s children tasks through all levels. |
TaskUtils()
public TaskUtils()
apply(Task root, ITreeAlgorithm<Task> alg, int level)
public static void apply(Task root, ITreeAlgorithm<Task> alg, int level)
Applies specified algorithm to each task of a tree.
Parameters:
Parameter | Type | Description |
---|---|---|
root | Task | Root of the tree |
alg | com.aspose.tasks.ITreeAlgorithm<com.aspose.tasks.Task> | Applied algorithm. |
level | int | Level of the root task. |
filter(Task root, ICondition<Task> cond)
public static Task filter(Task root, ICondition<Task> cond)
Builds new tree of tasks which satisfy the condition.
Parameters:
Parameter | Type | Description |
---|---|---|
root | Task | Root of the tree. |
cond | com.aspose.tasks.ICondition<com.aspose.tasks.Task> | Applied condition. |
Returns: Task - Root of a new tree.
find(Task root, ICondition<Task> cond)
public static Task find(Task root, ICondition<Task> cond)
Finds a task which satisfy the condition in a tree of tasks.
Parameters:
Parameter | Type | Description |
---|---|---|
root | Task | Root of the tree. |
cond | com.aspose.tasks.ICondition<com.aspose.tasks.Task> | Applied condition. |
Returns: Task - Task if task was found, otherwise null.
taskChildrenCount(Task task)
public static int taskChildrenCount(Task task)
Recursively calculates a number of task’s children tasks through all levels.
Parameters:
Parameter | Type | Description |
---|---|---|
task | Task | The task which children calculate. |
Returns: int - The number of children.