Interface ResourceCollection
-
-
Field Summary
Fields Modifier and Type Field Description static ResourceCollection
EMPTY
EmptyResourceCollection
object.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Resource
get(int index)
Returns the resource element at the specified position in this resource collection.Collection<Resource>
getCollection()
Returns a read-only collection over elements of typeResource
.int
size()
Returns the number of elements in this resource collection.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Field Detail
-
EMPTY
static final ResourceCollection EMPTY
EmptyResourceCollection
object.
-
-
Method Detail
-
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
Resource get(int index)
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())
-
-