Interface ResourceCollection
Read-only
Iterable
interface with some read-only Collection/List operations such as size()
or get(int)
.-
Field Summary
Modifier and TypeFieldDescriptionstatic final ResourceCollection
EmptyResourceCollection
object. -
Method Summary
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Field Details
-
EMPTY
EmptyResourceCollection
object.
-
-
Method Details
-
getCollection
Collection<Resource> getCollection()Returns a read-only collection over elements of typeResource
.This method is provided for templating language such as Freemarker because Freemarker doesn't allow to list or iterator an
Iterable
directly as of v2.3.x. for instance.- Returns:
- a resource collection.
-
size
int size()Returns the number of elements in this resource collection. If this resource collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.- Returns:
- the number of elements in this resource collection
-
get
Returns the resource element at the specified position in this resource collection.- Parameters:
index
- index of the resource element to return- Returns:
- the resource element at the specified position in this resource collection
- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size())
-