Package org.apache.sis.storage.geotiff
Class GeoTiffStore.Components
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
org.apache.sis.internal.util.ListOfUnknownSize<GridCoverageResource>
org.apache.sis.storage.geotiff.GeoTiffStore.Components
- All Implemented Interfaces:
Iterable<GridCoverageResource>
,Collection<GridCoverageResource>
,List<GridCoverageResource>
- Enclosing class:
- GeoTiffStore
The components returned by
GeoTiffStore.components
. Defined as a named class instead of an anonymous
class for more readable stack trace. This is especially useful since BackingStoreException
may happen in any method.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The collection size, cached when first computed.Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
exists
(int index) Returns whether the given index is valid.get
(int index) Returns element at the given index or throwIndexOutOfBoundsException
.private GridCoverageResource
getImageFileDirectory
(int index) Returns element at the given index or returnsnull
if the index is invalid.int
size()
Returns the size, computing and caching it if needed.protected int
Returns the size or -1 if not yet known.Methods inherited from class org.apache.sis.internal.util.ListOfUnknownSize
equals, isEmpty, listIterator, removeAll, spliterator, toArray, toArray
Methods inherited from class java.util.AbstractList
add, clear, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, retainAll, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, contains, containsAll, remove, replaceAll, retainAll, sort
-
Field Details
-
size
private int sizeThe collection size, cached when first computed.
-
-
Constructor Details
-
Components
private Components()
-
-
Method Details
-
sizeIfKnown
protected int sizeIfKnown()Returns the size or -1 if not yet known.- Overrides:
sizeIfKnown
in classListOfUnknownSize<GridCoverageResource>
- Returns:
ListOfUnknownSize.size()
if its value is already known, or any negative value if it still costly to compute.
-
size
public int size()Returns the size, computing and caching it if needed.- Specified by:
size
in interfaceCollection<GridCoverageResource>
- Specified by:
size
in interfaceList<GridCoverageResource>
- Overrides:
size
in classListOfUnknownSize<GridCoverageResource>
- Returns:
- the number of elements in this list.
-
exists
protected boolean exists(int index) Returns whether the given index is valid.- Specified by:
exists
in classListOfUnknownSize<GridCoverageResource>
- Parameters:
index
- the index where to verify if an element exists.- Returns:
true
if an element exists at the given index.
-
get
Returns element at the given index or throwIndexOutOfBoundsException
.- Specified by:
get
in interfaceList<GridCoverageResource>
- Specified by:
get
in classListOfUnknownSize<GridCoverageResource>
- Parameters:
index
- position of the element to get in this list.- Returns:
- the element at the given index.
-
getImageFileDirectory
Returns element at the given index or returnsnull
if the index is invalid.
-