class RegularImmutableList<E> extends ImmutableList<E>
ImmutableList
backed by a simple array.ImmutableList.Builder<E>, ImmutableList.SerializedForm, ImmutableList.SubList
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.Object[] |
array |
(package private) static ImmutableList<java.lang.Object> |
EMPTY |
SPLITERATOR_CHARACTERISTICS
Constructor and Description |
---|
RegularImmutableList(java.lang.Object[] array) |
Modifier and Type | Method and Description |
---|---|
(package private) int |
copyIntoArray(java.lang.Object[] dst,
int dstOff)
Copies the contents of this immutable collection into the specified array at the specified
offset.
|
E |
get(int index) |
(package private) java.lang.Object[] |
internalArray()
If this collection is backed by an array of its elements in insertion order, returns it.
|
(package private) int |
internalArrayEnd()
If this collection is backed by an array of its elements in insertion order, returns the offset
where this collection's elements end.
|
(package private) int |
internalArrayStart()
If this collection is backed by an array of its elements in insertion order, returns the offset
where this collection's elements start.
|
(package private) boolean |
isPartialView()
Returns
true if this immutable collection's implementation contains references to
user-created objects that aren't accessible via this collection's methods. |
UnmodifiableListIterator<E> |
listIterator(int index) |
int |
size() |
java.util.Spliterator<E> |
spliterator() |
add, addAll, asImmutableList, asImmutableList, asList, builder, builderWithExpectedSize, contains, copyOf, copyOf, copyOf, copyOf, equals, forEach, hashCode, indexOf, iterator, lastIndexOf, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, of, remove, replaceAll, reverse, set, sort, sortedCopyOf, sortedCopyOf, subList, subListUnchecked, toImmutableList, writeReplace
add, addAll, clear, remove, removeAll, removeIf, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
static final ImmutableList<java.lang.Object> EMPTY
final transient java.lang.Object[] array
public int size()
boolean isPartialView()
ImmutableCollection
true
if this immutable collection's implementation contains references to
user-created objects that aren't accessible via this collection's methods. This is generally
used to determine whether copyOf
implementations should make an explicit copy to avoid
memory leaks.isPartialView
in class ImmutableCollection<E>
java.lang.Object[] internalArray()
ImmutableCollection
internalArray
in class ImmutableCollection<E>
int internalArrayStart()
ImmutableCollection
internalArrayStart
in class ImmutableCollection<E>
int internalArrayEnd()
ImmutableCollection
internalArrayEnd
in class ImmutableCollection<E>
int copyIntoArray(java.lang.Object[] dst, int dstOff)
ImmutableCollection
offset + size()
.copyIntoArray
in class ImmutableList<E>
public E get(int index)
public UnmodifiableListIterator<E> listIterator(int index)
listIterator
in interface java.util.List<E>
listIterator
in class ImmutableList<E>
public java.util.Spliterator<E> spliterator()
spliterator
in interface java.lang.Iterable<E>
spliterator
in interface java.util.Collection<E>
spliterator
in interface java.util.List<E>
spliterator
in class ImmutableList<E>