TaskUtils

Inheritance: java.lang.Object

public class TaskUtils

Helper class which provides useful operations with tasks.

Constructors

ConstructorDescription
TaskUtils()

Methods

MethodDescription
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:

ParameterTypeDescription
rootTaskRoot of the tree
algcom.aspose.tasks.ITreeAlgorithm<com.aspose.tasks.Task>Applied algorithm.
levelintLevel 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:

ParameterTypeDescription
rootTaskRoot of the tree.
condcom.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:

ParameterTypeDescription
rootTaskRoot of the tree.
condcom.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:

ParameterTypeDescription
taskTaskThe task which children calculate.

Returns: int - The number of children.