public class TaskCollection extends AbstractList<T>
Represents a collection of Task
objects.
Modifier and Type | Method and Description |
---|---|
Task |
add()
Adds new task to project tasks collection on the same outline level of the last task.
|
Task |
add(RecurringTaskParameters parameters)
Inserts a new task before a task with the specified id and on the same outline level.
|
Task |
add(String taskName)
Adds a new task to children tasks collection.
|
Task |
add(String taskName,
int beforeTaskId)
Adds a new recurring task to children tasks collection.
|
boolean |
add(Task child)
Add the specified task to the instance of the
TaskCollection class. |
Task |
get(int index)
(@inheritDoc}
|
Task |
getById(int id)
Returns a task with the specified Id whose ancestor is parent task of this collection .
|
Task |
getByUid(int uid)
Returns a task with the specified Uid whose ancestor is parent task of this collection .
|
Project |
getParentProject()
Gets the parent project of the TaskCollection object.
|
boolean |
isReadOnly()
Gets a value indicating whether this collection is read only.
|
int |
size()
Gets the number of objects contained in the TaskCollection.
|
void |
sort(Comparator<? super Task> c) |
List<Task> |
toList()
Converts the TaskCollection object to a list of
Task objects. |
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, spliterator, toArray, toArray
parallelStream, removeIf, stream
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).
add
in interface Collection<Task>
add
in interface List<Task>
add
in class AbstractList<Task>
child
- the specified task which should be added to this task collection.public final Task add()
Adds new task to project tasks collection on the same outline level of the last task.
Task
class.public final Task add(String taskName)
Adds a new task to children tasks collection.
taskName
- the specified task name.Task
class.public final Task add(String taskName, int beforeTaskId)
Adds a new recurring task to children tasks collection.
taskName
- the specified task name.beforeTaskId
- int
the specified id of a task before which a new task will be inserted.com.aspose.ms.System.ArgumentOutOfRangeException
- ArgumentOutOfRangeException is thrown if the specified id is not a
valid task id.public final Task add(RecurringTaskParameters parameters)
Inserts a new task before a task with the specified id and on the same outline level.
parameters
- RecurringTaskParameters
the specified parameters for creation of recurring
task.Task
class.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.public Task get(int index)
public final Task getById(int id)
Returns a task with the specified Id whose ancestor is parent task of this collection .
id
- TaskEntity IdTask
class with the specified id whose ancestor is parent task of this
collection.public final Task getByUid(int uid)
Returns a task with the specified Uid whose ancestor is parent task of this collection .
uid
- TaskEntity Uid.Task
class with the specified uid whose ancestor is parent task of this
collection.public final Project getParentProject()
Gets the parent project of the TaskCollection object.
public final boolean isReadOnly()
Gets a value indicating whether this collection is read only.
public final int size()
Gets the number of objects contained in the TaskCollection.
int
.size
in interface Collection<Task>
size
in interface List<Task>
size
in class AbstractCollection<Task>
public final void sort(Comparator<? super Task> c)