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
Resource
objects.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resource
add()
Adds new resource at the last position of a project resources collection.boolean
add(Resource e)
Resource
add(String resourceName)
Adds new resource at the last position of a project resources collection.Resource
add(String resourceName, int beforeResourceId)
Adds new resource at the specified position of a project resources collection.void
clear()
Direct clearing is not supported, this method just throw UnsupportedOperationException.boolean
contains(Object o)
Resource
get(int index)
(@inheritDoc}Resource
getById(int id)
Returns a resource with the specified id.Resource
getByUid(int uid)
Returns a resource with the specified Uid.Project
getParentProject()
Gets the parent project of the ResourceCollection object.int
indexOf(Object o)
boolean
isReadOnly()
Iterator<Resource>
iterator()
Returns an enumerator for this collection.boolean
remove(Object o)
This is the stub implementation of Collection's remove method, that only throws UnsupportedOperationExceptionint
size()
Gets the number of elements contained in the ResourceCollection.void
sort(Comparator<? super Resource> comparer)
List<Resource>
toList()
Converts the ResourceCollection object to a list ofResource
objects.-
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:
add
in interfaceCollection<Resource>
- Specified by:
add
in interfaceList<Resource>
- Overrides:
add
in classAbstractList<Resource>
- Parameters:
e
-- Returns:
-
clear
public final void clear()
Direct clearing is not supported, this method just throw UnsupportedOperationException.
- Specified by:
clear
in interfaceCollection<Resource>
- Specified by:
clear
in interfaceList<Resource>
- Overrides:
clear
in classAbstractList<Resource>
-
contains
public final boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<Resource>
- Specified by:
contains
in interfaceList<Resource>
- Overrides:
contains
in 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:
remove
in interfaceCollection<Resource>
- Specified by:
remove
in interfaceList<Resource>
- Overrides:
remove
in classAbstractCollection<Resource>
- Parameters:
o
- the item to remove.- Returns:
true
if the item was removed;false
otherwise.
-
size
public final int size()
Gets the number of elements contained in the ResourceCollection.
Read-onlyint
.- Specified by:
size
in interfaceCollection<Resource>
- Specified by:
size
in interfaceList<Resource>
- Specified by:
size
in 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
Resource
objects.- Returns:
- List of
Resource
objects.
-
-