public class ResourceCollection extends AbstractList<T>
Represents a collection of Resource
objects.
Modifier and Type | Method and Description |
---|---|
Resource |
add()
Adds new resource at the last position of a project resources collection.
|
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.
|
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 |
size()
Gets the number of elements contained in the ResourceCollection.
|
void |
sort(Comparator<? super Resource> c) |
List<Resource> |
toList()
Converts the ResourceCollection object to a list of
Resource objects. |
add, 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 Resource add()
Adds new resource at the last position of a project resources collection.
public final Resource add(String resourceName)
Adds new resource at the last position of a project resources collection.
resourceName
- Name of a resource.public final Resource add(String resourceName, int beforeResourceId)
Adds new resource at the specified position of a project resources collection.
resourceName
- Name of a resource.beforeResourceId
- Position of a resource in a project resources collection.public final Resource getById(int id)
Returns a resource with the specified id.
id
- The specified id.
public final Resource getByUid(int uid)
Returns a resource with the specified Uid.
uid
- The specified uid.
public final Project getParentProject()
Gets the parent project of the ResourceCollection object.
public final int size()
Gets the number of elements contained in the ResourceCollection.
int
.size
in interface Collection<Resource>
size
in interface List<Resource>
size
in class AbstractCollection<Resource>
public final void sort(Comparator<? super Resource> c)
public final List<Resource> toList()
Converts the ResourceCollection object to a list of Resource
objects.
Resource
objects.