E
- the primitive typepublic interface PrimitiveList<E> extends PrimitiveCollection<E>, java.util.List<E>
This interface extends List
allowing seamless integration with other APIs.
All List methods can be used, using the primitive wrapper class.
However, it will be much more efficient to use the direct primitive methods
in the subinterface.
Modifier and Type | Method and Description |
---|---|
E |
first()
Gets the first list value.
|
E |
last()
Gets the last list value.
|
boolean |
removeRange(int fromIndexInclusive,
int toIndexExclusive)
Removes a range of values from the list (optional operation).
|
containsAny
clear, clone, isEmpty, isModifiable, optimize, size
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
E first()
E last()
size() - 1
or null if the size is zeroboolean removeRange(int fromIndexInclusive, int toIndexExclusive)
This method is optional, throwing an UnsupportedOperationException if the list cannot be modified.
fromIndexInclusive
- the start of the range to remove, inclusivetoIndexExclusive
- the end of the range to remove, exclusivetrue
if the collection was modifiedjava.lang.IndexOutOfBoundsException
- if the index is invalidjava.lang.UnsupportedOperationException
- if remove is not supportedCopyright © 2005–2018 Joda.org. All rights reserved.