@GwtCompatible(emulated=true) class RegularImmutableAsList<E> extends ImmutableAsList<E>
ImmutableAsList
implementation specialized for when the delegate collection is already
backed by an ImmutableList
or array.ImmutableAsList.SerializedForm
ImmutableList.Builder<E>, ImmutableList.SubList
Modifier and Type | Field and Description |
---|---|
private ImmutableCollection<E> |
delegate |
private ImmutableList<? extends E> |
delegateList |
SPLITERATOR_CHARACTERISTICS
Constructor and Description |
---|
RegularImmutableAsList(ImmutableCollection<E> delegate,
ImmutableList<? extends E> delegateList) |
RegularImmutableAsList(ImmutableCollection<E> delegate,
java.lang.Object[] array) |
Modifier and Type | Method and Description |
---|---|
(package private) int |
copyIntoArray(java.lang.Object[] dst,
int offset)
Copies the contents of this immutable collection into the specified array at the specified
offset.
|
(package private) ImmutableCollection<E> |
delegateCollection() |
(package private) ImmutableList<? extends E> |
delegateList() |
void |
forEach(java.util.function.Consumer<? super E> action) |
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.
|
UnmodifiableListIterator<E> |
listIterator(int index) |
contains, isEmpty, isPartialView, size, writeReplace
add, addAll, asImmutableList, asImmutableList, asList, builder, builderWithExpectedSize, copyOf, copyOf, copyOf, copyOf, equals, 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, spliterator, subList, subListUnchecked, toImmutableList
add, addAll, clear, remove, removeAll, removeIf, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private final ImmutableCollection<E> delegate
private final ImmutableList<? extends E> delegateList
RegularImmutableAsList(ImmutableCollection<E> delegate, ImmutableList<? extends E> delegateList)
RegularImmutableAsList(ImmutableCollection<E> delegate, java.lang.Object[] array)
ImmutableCollection<E> delegateCollection()
delegateCollection
in class ImmutableAsList<E>
ImmutableList<? extends E> delegateList()
public UnmodifiableListIterator<E> listIterator(int index)
listIterator
in interface java.util.List<E>
listIterator
in class ImmutableList<E>
@GwtIncompatible public void forEach(java.util.function.Consumer<? super E> action)
forEach
in interface java.lang.Iterable<E>
forEach
in class ImmutableList<E>
@GwtIncompatible int copyIntoArray(java.lang.Object[] dst, int offset)
ImmutableCollection
offset + size()
.copyIntoArray
in class ImmutableList<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>
public E get(int index)