com.aspose.tasks

Interfaces

Classes

Exceptions

com.aspose.tasks

Class TaskCollection

  • All Implemented Interfaces:
    Iterable<Task>


    public class TaskCollection
    extends Object
    implements Iterable<Task>

    Represents a collection of Task objects.

    • Method Detail

      • getCount

        public int getCount()

        Returns the number of objects contained in the TaskCollection.

        Returns:
        returns the number of objects contained in the TaskCollection.
      • getParentProject

        public Project getParentProject()

        Gets the parent project of the TaskCollection object.

        Returns:
        returns the parent project of the TaskCollection object.
      • isReadOnly

        public boolean isReadOnly()

        Determines whether this collection is read only.

        Returns:
        returns a flag which determines whether this collection is read only.
      • add

        public void add(Task child)

        Add the specified task to the instance of the TaskCollection class. If ParentProject.CalculationMode is None user should invoke Project.Recalculate() after using this method (It will reschedule all project tasks (start/finish dates, sets early/late dates) and calculate the dependent fields such as slacks, work and cost fields, ids and outline levels). If ParentProject.CalculationMode is Manual the method will calculate only task id, outline level and outline numbers automatically. If ParentProject.CalculationMode is Automatic the method reschedules all project's tasks automatically (start/finish dates, sets early/late dates, calculates slacks, work and cost fields, recalculates ids and outline levels).

        Parameters:
        child - the specified task which should be added to this task collection.
      • add

        public Task add(String taskName,
                        int beforeTaskId)

        Inserts a new task before a task with the specified id and on the same outline level.

        Parameters:
        taskName - the specified task name.
        beforeTaskId - int the specified id of a task before which a new task will be inserted.
        Returns:
        returns a task which was inserted before a task with the specified id.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - is thrown if the specified id is not a valid task id.
      • add

        public Task add()

        Adds new task to project tasks collection on the same outline level of the last task.

        Returns:
        returns the newly added instance of the Task class.
      • add

        public Task add(String taskName)

        Adds a new task to children tasks collection.

        Parameters:
        taskName - the specified task name.
        Returns:
        returns the newly added instance of the Task class.
      • getById

        public Task getById(int id)

        Returns a task with the specified Id whose ancestor is parent task of this collection .

        Parameters:
        id - TaskEntity Id
        Returns:
        returns the instance of Task class with the specified id whose ancestor is parent task of this collection.
      • getByUid

        public Task getByUid(int uid)

        Returns a task with the specified Uid whose ancestor is parent task of this collection .

        Parameters:
        uid - the specified task Uid.
        Returns:
        returns the instance of Task class with the specified uid whose ancestor is parent task of this collection.
      • toList

        public List<Task> toList()

        Converts the TaskCollection object to a list of Task objects.

        Returns:
        returns a list of Task objects.