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
ResourceAssignment
objects.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(ResourceAssignment item)
This is the stub implementation of ICollection's Add method, that only throws UnsupportedOperationExceptionResourceAssignment
add(Task task, Resource resource)
Adds new assignment to the ResourceAssignmentCollection.ResourceAssignment
add(Task task, Resource resource, double units)
Adds new assignment to the ResourceAssignmentCollection.ResourceAssignment
add(Task task, Resource resource, BigDecimal cost)
Adds new assignment to the ResourceAssignmentCollection.void
clear()
Removes all items from the collection.boolean
contains(Object o)
ResourceAssignment
get(int index)
(@inheritDoc}ResourceAssignment
getByUid(int uid)
Returns an assignment with the specified uid.Project
getParentProject()
Gets the parent project of the ResourceAssignmentCollection object.int
indexOf(Object o)
boolean
isReadOnly()
Gets a value indicating whether this collection is read only.Iterator<ResourceAssignment>
iterator()
Returns an enumerator for this collection.ResourceAssignment
remove(int index)
boolean
remove(Object o)
Removes specified assignment from collection, if it is not read-only, otherwise throws UnsupportedOperationException.int
size()
Gets the number of objects contained in the ResourceAssignmentCollection.void
sort(Comparator<? super T> c)
List<ResourceAssignment>
toList()
Converts the ResourceAssignmentCollection object to a list ofResourceAssignment
objects.-
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:
add
in interfaceCollection<ResourceAssignment>
- Specified by:
add
in interfaceList<ResourceAssignment>
- Overrides:
add
in classAbstractList<ResourceAssignment>
- Parameters:
item
- The item to remove.- Returns:
-
clear
public void clear()
Removes all items from the collection.- Specified by:
clear
in interfaceCollection<ResourceAssignment>
- Specified by:
clear
in interfaceList<ResourceAssignment>
- Overrides:
clear
in classAbstractList<ResourceAssignment>
-
contains
public final boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<ResourceAssignment>
- Specified by:
contains
in interfaceList<ResourceAssignment>
- Overrides:
contains
in 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:
indexOf
in interfaceList<ResourceAssignment>
- Overrides:
indexOf
in 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:
iterator
in interfaceCollection<ResourceAssignment>
- Specified by:
iterator
in interfaceIterable<ResourceAssignment>
- Specified by:
iterator
in interfaceList<ResourceAssignment>
- Overrides:
iterator
in 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:
remove
in interfaceCollection<ResourceAssignment>
- Specified by:
remove
in interfaceList<ResourceAssignment>
- Overrides:
remove
in 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:
size
in interfaceCollection<ResourceAssignment>
- Specified by:
size
in interfaceList<ResourceAssignment>
- Specified by:
size
in 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
ResourceAssignment
objects.- Returns:
- List of
ResourceAssignment
objects.
-
get
public ResourceAssignment get(int index)
(@inheritDoc}- Specified by:
get
in interfaceList<ResourceAssignment>
- Specified by:
get
in classAbstractList<ResourceAssignment>
- Parameters:
index
-- Returns:
-
remove
public ResourceAssignment remove(int index)
- Specified by:
remove
in interfaceList<ResourceAssignment>
- Overrides:
remove
in classAbstractList<ResourceAssignment>
- Parameters:
index
-- Returns:
-
sort
public void sort(Comparator<? super T> c)
- Parameters:
c
-
-
-