ResourceCollection

Inheritance: java.lang.Object, java.util.AbstractCollection, java.util.AbstractList, com.aspose.tasks.AbstractList

public class ResourceCollection extends AbstractList<Resource>

Represents a collection of Resource objects.

Methods

MethodDescription
add()Adds new resource at the last position of a project resources collection.
add(Resource e){@inheritDoc}
add(String resourceName)Adds new resource at the last position of a project resources collection.
add(String resourceName, int beforeResourceId)Adds new resource at the specified position of a project resources collection.
clear()Direct clearing is not supported, this method just throw UnsupportedOperationException.
contains(Object o){@inheritDoc}
get(int index)(@inheritDoc}
getById(int id)Returns a resource with the specified id.
getByUid(int uid)Returns a resource with the specified Uid.
getParentProject()Gets the parent project of the ResourceCollection object.
indexOf(Object o){@inheritDoc}
isReadOnly(){@inheritDoc}
iterator()Returns an enumerator for this collection.
remove(Object o)This is the stub implementation of Collection’s remove method, that only throws UnsupportedOperationException
size()Gets the number of elements contained in the ResourceCollection.
sort(Comparator<? super Resource> comparer){@inheritDoc}
toList()Converts the ResourceCollection object to a list of Resource objects.

add()

public final Resource add()

Adds new resource at the last position of a project resources collection.

Returns: Resource - Added resource.

add(Resource e)

public final boolean add(Resource e)

Parameters:

ParameterTypeDescription
eResource{@inheritDoc}

Returns: boolean - {@inheritDoc}

add(String resourceName)

public final Resource add(String resourceName)

Adds new resource at the last position of a project resources collection.

Parameters:

ParameterTypeDescription
resourceNamejava.lang.StringName of a resource.

Returns: Resource - Added resource.

add(String resourceName, int beforeResourceId)

public final Resource add(String resourceName, int beforeResourceId)

Adds new resource at the specified position of a project resources collection.

Parameters:

ParameterTypeDescription
resourceNamejava.lang.StringName of a resource.
beforeResourceIdintPosition of the previous resource in a project resources collection.

Returns: Resource - Added resource.

clear()

public final void clear()

Direct clearing is not supported, this method just throw UnsupportedOperationException.

contains(Object o)

public final boolean contains(Object o)

Parameters:

ParameterTypeDescription
ojava.lang.Object{@inheritDoc}

Returns: boolean - {@inheritDoc}

get(int index)

public Resource get(int index)

(@inheritDoc}

Parameters:

ParameterTypeDescription
indexint{@inheritDoc}

Returns: Resource - {@inheritDoc}

getById(int id)

public final Resource getById(int id)

Returns a resource with the specified id.

Parameters:

ParameterTypeDescription
idintThe specified id.

O(1) complexity. |

Returns: Resource - Resource with the specified id if present; otherwise, null.

getByUid(int uid)

public final Resource getByUid(int uid)

Returns a resource with the specified Uid.

Parameters:

ParameterTypeDescription
uidintThe specified uid.

O(1) complexity. |

Returns: Resource - Resource with the specified uid if present; otherwise, null.

getParentProject()

public final Project getParentProject()

Gets the parent project of the ResourceCollection object.

Returns: Project - the parent project of the ResourceCollection object.

indexOf(Object o)

public final int indexOf(Object o)

Parameters:

ParameterTypeDescription
ojava.lang.Object{@inheritDoc}

Returns: int - {@inheritDoc}

isReadOnly()

public final boolean isReadOnly()

Returns: boolean - {@inheritDoc}

iterator()

public final Iterator<Resource> iterator()

Returns an enumerator for this collection.

Returns: java.util.Iterator<com.aspose.tasks.Resource> - an enumerator for this collection.

remove(Object o)

public final boolean remove(Object o)

This is the stub implementation of Collection’s remove method, that only throws UnsupportedOperationException

Parameters:

ParameterTypeDescription
ojava.lang.Objectthe item to remove.

Returns: boolean - true if the item was removed; false otherwise.

size()

public final int size()

Gets the number of elements contained in the ResourceCollection.


Read-only int.

Returns: int - the number of elements contained in the ResourceCollection.

sort(Comparator<? super Resource> comparer)

public final void sort(Comparator<? super Resource> comparer)

Parameters:

ParameterTypeDescription
comparerjava.util.Comparator<? super com.aspose.tasks.Resource>{@inheritDoc}

toList()

public final List<Resource> toList()

Converts the ResourceCollection object to a list of Resource objects.

Returns: java.util.List<com.aspose.tasks.Resource> - List of Resource objects.