Class ResourceAssignmentCollection
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- com.aspose.tasks.ResourceAssignmentCollection
-
- All Implemented Interfaces:
Iterable<ResourceAssignment>,Collection<ResourceAssignment>,List<ResourceAssignment>
public class ResourceAssignmentCollection extends AbstractList<T>
Represents a collection of
ResourceAssignmentobjects.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(ResourceAssignment item)This is the stub implementation of ICollection's Add method, that only throws UnsupportedOperationExceptionResourceAssignmentadd(Task task, Resource resource)Adds new assignment to the ResourceAssignmentCollection.ResourceAssignmentadd(Task task, Resource resource, double units)Adds new assignment to the ResourceAssignmentCollection.ResourceAssignmentadd(Task task, Resource resource, BigDecimal cost)Adds new assignment to the ResourceAssignmentCollection.voidclear()Removes all items from the collection.booleancontains(Object o)ResourceAssignmentget(int index)(@inheritDoc}ResourceAssignmentgetByUid(int uid)Returns an assignment with the specified uid.ProjectgetParentProject()Gets the parent project of the ResourceAssignmentCollection object.intindexOf(Object o)booleanisReadOnly()Gets a value indicating whether this collection is read only.Iterator<ResourceAssignment>iterator()Returns an enumerator for this collection.ResourceAssignmentremove(int index)booleanremove(Object o)Removes specified assignment from collection, if it is not read-only, otherwise throws UnsupportedOperationException.intsize()Gets the number of objects contained in the ResourceAssignmentCollection.voidsort(Comparator<? super T> c)List<ResourceAssignment>toList()Converts the ResourceAssignmentCollection object to a list ofResourceAssignmentobjects.-
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, lastIndexOf, listIterator, listIterator, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, containsAll, isEmpty, removeAll, replaceAll, retainAll, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
add
public final ResourceAssignment add(Task task, Resource resource, double units)
Adds new assignment to the ResourceAssignmentCollection.
- Parameters:
task- A task to be assigned.resource- A resource to be assigned.units- The number of units for a new assignment.- Returns:
- Added assignment.
-
add
public final ResourceAssignment add(Task task, Resource resource, BigDecimal cost)
Adds new assignment to the ResourceAssignmentCollection.
- Parameters:
task- A task to be assigned.resource- A cost resource to be assigned.cost- The cost for a new assignment.- Returns:
- Added assignment.
-
add
public final ResourceAssignment add(Task task, Resource resource)
Adds new assignment to the ResourceAssignmentCollection.
- Parameters:
task- A task to be assigned.resource- A resource to be assigned.- Returns:
- Added assignment.
-
add
public final boolean add(ResourceAssignment item)
This is the stub implementation of ICollection's Add method, that only throws UnsupportedOperationException
- Specified by:
addin interfaceCollection<ResourceAssignment>- Specified by:
addin interfaceList<ResourceAssignment>- Overrides:
addin classAbstractList<ResourceAssignment>- Parameters:
item- The item to remove.- Returns:
-
clear
public void clear()
Removes all items from the collection.- Specified by:
clearin interfaceCollection<ResourceAssignment>- Specified by:
clearin interfaceList<ResourceAssignment>- Overrides:
clearin classAbstractList<ResourceAssignment>
-
contains
public final boolean contains(Object o)
- Specified by:
containsin interfaceCollection<ResourceAssignment>- Specified by:
containsin interfaceList<ResourceAssignment>- Overrides:
containsin classAbstractCollection<ResourceAssignment>- Parameters:
o-- Returns:
-
getByUid
public final ResourceAssignment getByUid(int uid)
Returns an assignment with the specified uid.
- Parameters:
uid- The specified uid.
O(1) complexity.- Returns:
- ResourceAssignment with the specified uid if present; otherwise, null.
-
getParentProject
public final Project getParentProject()
Gets the parent project of the ResourceAssignmentCollection object.
- Returns:
- the parent project of the ResourceAssignmentCollection object.
-
indexOf
public final int indexOf(Object o)
- Specified by:
indexOfin interfaceList<ResourceAssignment>- Overrides:
indexOfin classAbstractList<ResourceAssignment>- Parameters:
o-- Returns:
-
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.
-
iterator
public final Iterator<ResourceAssignment> iterator()
Returns an enumerator for this collection.
- Specified by:
iteratorin interfaceCollection<ResourceAssignment>- Specified by:
iteratorin interfaceIterable<ResourceAssignment>- Specified by:
iteratorin interfaceList<ResourceAssignment>- Overrides:
iteratorin classAbstractList<ResourceAssignment>- Returns:
- an enumerator for this collection.
-
remove
public final boolean remove(Object o)
Removes specified assignment from collection, if it is not read-only, otherwise throws UnsupportedOperationException.
- Specified by:
removein interfaceCollection<ResourceAssignment>- Specified by:
removein interfaceList<ResourceAssignment>- Overrides:
removein classAbstractCollection<ResourceAssignment>- Parameters:
o- The assignment to remove.- Returns:
- true, if specified item was removed, false otherwise.
-
size
public final int size()
Gets the number of objects contained in the ResourceAssignmentCollection.
- Specified by:
sizein interfaceCollection<ResourceAssignment>- Specified by:
sizein interfaceList<ResourceAssignment>- Specified by:
sizein classAbstractCollection<ResourceAssignment>- Returns:
- the number of objects contained in the ResourceAssignmentCollection.
-
toList
public final List<ResourceAssignment> toList()
Converts the ResourceAssignmentCollection object to a list of
ResourceAssignmentobjects.- Returns:
- List of
ResourceAssignmentobjects.
-
get
public ResourceAssignment get(int index)
(@inheritDoc}- Specified by:
getin interfaceList<ResourceAssignment>- Specified by:
getin classAbstractList<ResourceAssignment>- Parameters:
index-- Returns:
-
remove
public ResourceAssignment remove(int index)
- Specified by:
removein interfaceList<ResourceAssignment>- Overrides:
removein classAbstractList<ResourceAssignment>- Parameters:
index-- Returns:
-
sort
public void sort(Comparator<? super T> c)
- Parameters:
c-
-
-