Package org.apache.sis.internal.util
Class UnmodifiableArrayList.SubList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
org.apache.sis.internal.util.UnmodifiableArrayList<E>
org.apache.sis.internal.util.UnmodifiableArrayList.SubList<E>
- Type Parameters:
E
- the type of elements in the list.
- All Implemented Interfaces:
Serializable
,Iterable<E>
,Collection<E>
,List<E>
,RandomAccess
,SequencedCollection<E>
,CheckedContainer<E>
- Enclosing class:
UnmodifiableArrayList<E>
A view over a portion of
UnmodifiableArrayList
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
Index of the first element and size of this list.private static final long
For cross-version compatibility.private final int
Index of the first element and size of this list.Fields inherited from class org.apache.sis.internal.util.UnmodifiableArrayList
array
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.sis.internal.util.UnmodifiableArrayList
arraySize, contains, equals, getElementType, indexOf, lastIndexOf, subList, toArray, wrap, wrap
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, hashCode, iterator, listIterator, listIterator, remove, removeRange, set
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, 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, addFirst, addLast, containsAll, getFirst, getLast, isEmpty, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
lower
private final int lowerIndex of the first element and size of this list. -
size
private final int sizeIndex of the first element and size of this list.
-
-
Constructor Details
-
SubList
SubList(E[] array, int lower, int size) Creates a new sublist.WARNING! Type safety hole
Callers must ensure that the type of array elements in exactlyE
, not a subtype ofE
. SeeUnmodifiableArrayList
class javadoc for more information.
-
-
Method Details
-
lower
int lower()Returns the index of the first element.- Overrides:
lower
in classUnmodifiableArrayList<E>
-
size
public int size()Returns the size of this list.- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceList<E>
- Overrides:
size
in classUnmodifiableArrayList<E>
- Returns:
- the size of this list.
-
get
Returns the element at the given index. -
toArray
Returns a copy of the backing array section viewed by this sublist.- Specified by:
toArray
in interfaceCollection<E>
- Specified by:
toArray
in interfaceList<E>
- Overrides:
toArray
in classUnmodifiableArrayList<E>
- Returns:
- a copy of the wrapped array.
-