com.aspose.tasks

Interfaces

Classes

Exceptions

com.aspose.tasks

Class TaskCollection

    • Method Detail

      • add

        public final boolean 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).

        Specified by:
        add in interface Collection<Task>
        Specified by:
        add in interface List<Task>
        Overrides:
        add in class AbstractList<Task>
        Parameters:
        child - the specified task which should be added to this task collection.
        Returns:
        true if operation was successful.
      • add

        public final 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 final 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.
      • add

        public final Task add(String taskName,
                              int beforeTaskId)

        Adds a new recurring task to children tasks collection.

        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 - ArgumentOutOfRangeException is thrown if the specified id is not a valid task id.
      • add

        public final Task add(RecurringTaskParameters parameters)

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

        Parameters:
        parameters - RecurringTaskParameters the specified parameters for creation of recurring task.
        Returns:
        returns the newly added instance of the Task class.
        Throws:
        com.aspose.ms.System.ArgumentNullException - ArgumentNullException is thrown if the specified parameters are null.
        com.aspose.ms.System.ArgumentException - ArgumentException is thrown if the specified parameters are invalid.
      • get

        public Task get(int index)
        (@inheritDoc}
        Specified by:
        get in interface List<Task>
        Specified by:
        get in class AbstractList<Task>
        Parameters:
        index -
        Returns:
      • getById

        public final 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 final Task getByUid(int uid)

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

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

        public final Project getParentProject()

        Gets the parent project of the TaskCollection object.

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

        public final boolean isReadOnly()

        Gets a value indicating whether this collection is read only.

        Returns:
        a value indicating whether this collection is read only.
      • size

        public final int size()

        Gets the number of objects contained in the TaskCollection.


        Read only int.
        Specified by:
        size in interface Collection<Task>
        Specified by:
        size in interface List<Task>
        Specified by:
        size in class AbstractCollection<Task>
        Returns:
        the number of objects contained in the TaskCollection.
      • toList

        public final List<Task> toList()

        Converts the TaskCollection object to a list of Task objects.

        Returns:
        returns a list which contains the Task class instances of this collection.