Class ResourceCollection
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- com.aspose.tasks.ResourceCollection
-
public class ResourceCollection extends AbstractList<T>
Represents a collection of
Resourceobjects.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resourceadd()Adds new resource at the last position of a project resources collection.booleanadd(Resource e)Resourceadd(String resourceName)Adds new resource at the last position of a project resources collection.Resourceadd(String resourceName, int beforeResourceId)Adds new resource at the specified position of a project resources collection.voidclear()Direct clearing is not supported, this method just throw UnsupportedOperationException.booleancontains(Object o)Resourceget(int index)(@inheritDoc}ResourcegetById(int id)Returns a resource with the specified id.ResourcegetByUid(int uid)Returns a resource with the specified Uid.ProjectgetParentProject()Gets the parent project of the ResourceCollection object.intindexOf(Object o)booleanisReadOnly()Iterator<Resource>iterator()Returns an enumerator for this collection.booleanremove(Object o)This is the stub implementation of Collection's remove method, that only throws UnsupportedOperationExceptionintsize()Gets the number of elements contained in the ResourceCollection.voidsort(Comparator<? super Resource> comparer)List<Resource>toList()Converts the ResourceCollection object to a list ofResourceobjects.-
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, lastIndexOf, listIterator, listIterator, remove, 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 Resource add()
Adds new resource at the last position of a project resources collection.
- Returns:
- Added resource.
-
add
public final Resource add(String resourceName)
Adds new resource at the last position of a project resources collection.
- Parameters:
resourceName- Name of a resource.- Returns:
- Added resource.
-
add
public final Resource add(String resourceName, int beforeResourceId)
Adds new resource at the specified position of a project resources collection.
- Parameters:
resourceName- Name of a resource.beforeResourceId- Position of the previous resource in a project resources collection.- Returns:
- Added resource.
-
add
public final boolean add(Resource e)
- Specified by:
addin interfaceCollection<Resource>- Specified by:
addin interfaceList<Resource>- Overrides:
addin classAbstractList<Resource>- Parameters:
e-- Returns:
-
clear
public final void clear()
Direct clearing is not supported, this method just throw UnsupportedOperationException.
- Specified by:
clearin interfaceCollection<Resource>- Specified by:
clearin interfaceList<Resource>- Overrides:
clearin classAbstractList<Resource>
-
contains
public final boolean contains(Object o)
- Specified by:
containsin interfaceCollection<Resource>- Specified by:
containsin interfaceList<Resource>- Overrides:
containsin classAbstractCollection<Resource>- Parameters:
o-- Returns:
-
getById
public final Resource getById(int id)
Returns a resource with the specified id.
- Parameters:
id- The specified id.
O(1) complexity.- Returns:
- Resource with the specified id if present; otherwise, null.
-
getByUid
public final Resource getByUid(int uid)
Returns a resource with the specified Uid.
- Parameters:
uid- The specified uid.
O(1) complexity.- Returns:
- Resource with the specified uid if present; otherwise, null.
-
getParentProject
public final Project getParentProject()
Gets the parent project of the ResourceCollection object.
- Returns:
- the parent project of the ResourceCollection object.
-
indexOf
public final int indexOf(Object o)
-
isReadOnly
public final boolean isReadOnly()
- Returns:
-
remove
public final boolean remove(Object o)
This is the stub implementation of Collection's remove method, that only throws UnsupportedOperationException
- Specified by:
removein interfaceCollection<Resource>- Specified by:
removein interfaceList<Resource>- Overrides:
removein classAbstractCollection<Resource>- Parameters:
o- the item to remove.- Returns:
trueif the item was removed;falseotherwise.
-
size
public final int size()
Gets the number of elements contained in the ResourceCollection.
Read-onlyint.- Specified by:
sizein interfaceCollection<Resource>- Specified by:
sizein interfaceList<Resource>- Specified by:
sizein classAbstractCollection<Resource>- Returns:
- the number of elements contained in the ResourceCollection.
-
sort
public final void sort(Comparator<? super Resource> comparer)
-
toList
public final List<Resource> toList()
Converts the ResourceCollection object to a list of
Resourceobjects.- Returns:
- List of
Resourceobjects.
-
-