Package com.google.common.collect
Class RegularImmutableAsList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- com.google.common.collect.ImmutableCollection<E>
-
- com.google.common.collect.ImmutableList<E>
-
- com.google.common.collect.ImmutableAsList<E>
-
- com.google.common.collect.RegularImmutableAsList<E>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>,java.util.RandomAccess
- Direct Known Subclasses:
ImmutableSortedAsList
@GwtCompatible(emulated=true) class RegularImmutableAsList<E> extends ImmutableAsList<E>
AnImmutableAsListimplementation specialized for when the delegate collection is already backed by anImmutableListor array.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.collect.ImmutableAsList
ImmutableAsList.SerializedForm
-
Nested classes/interfaces inherited from class com.google.common.collect.ImmutableList
ImmutableList.Builder<E>, ImmutableList.SubList
-
-
Field Summary
Fields Modifier and Type Field Description private ImmutableCollection<E>delegateprivate ImmutableList<? extends E>delegateList-
Fields inherited from class com.google.common.collect.ImmutableCollection
SPLITERATOR_CHARACTERISTICS
-
-
Constructor Summary
Constructors Constructor Description RegularImmutableAsList(ImmutableCollection<E> delegate, ImmutableList<? extends E> delegateList)RegularImmutableAsList(ImmutableCollection<E> delegate, java.lang.Object[] array)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intcopyIntoArray(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()voidforEach(java.util.function.Consumer<? super E> action)Eget(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) intinternalArrayEnd()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) intinternalArrayStart()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)-
Methods inherited from class com.google.common.collect.ImmutableAsList
contains, isEmpty, isPartialView, size, writeReplace
-
Methods inherited from class com.google.common.collect.ImmutableList
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
-
Methods inherited from class com.google.common.collect.ImmutableCollection
add, addAll, clear, remove, removeAll, removeIf, retainAll, toArray, toArray
-
-
-
-
Field Detail
-
delegate
private final ImmutableCollection<E> delegate
-
delegateList
private final ImmutableList<? extends E> delegateList
-
-
Constructor Detail
-
RegularImmutableAsList
RegularImmutableAsList(ImmutableCollection<E> delegate, ImmutableList<? extends E> delegateList)
-
RegularImmutableAsList
RegularImmutableAsList(ImmutableCollection<E> delegate, java.lang.Object[] array)
-
-
Method Detail
-
delegateCollection
ImmutableCollection<E> delegateCollection()
- Specified by:
delegateCollectionin classImmutableAsList<E>
-
delegateList
ImmutableList<? extends E> delegateList()
-
listIterator
public UnmodifiableListIterator<E> listIterator(int index)
- Specified by:
listIteratorin interfacejava.util.List<E>- Overrides:
listIteratorin classImmutableList<E>
-
forEach
@GwtIncompatible public void forEach(java.util.function.Consumer<? super E> action)
- Specified by:
forEachin interfacejava.lang.Iterable<E>- Overrides:
forEachin classImmutableList<E>
-
copyIntoArray
@GwtIncompatible int copyIntoArray(java.lang.Object[] dst, int offset)
Description copied from class:ImmutableCollectionCopies the contents of this immutable collection into the specified array at the specified offset. Returnsoffset + size().- Overrides:
copyIntoArrayin classImmutableList<E>
-
internalArray
java.lang.Object[] internalArray()
Description copied from class:ImmutableCollectionIf this collection is backed by an array of its elements in insertion order, returns it.- Overrides:
internalArrayin classImmutableCollection<E>
-
internalArrayStart
int internalArrayStart()
Description copied from class:ImmutableCollectionIf this collection is backed by an array of its elements in insertion order, returns the offset where this collection's elements start.- Overrides:
internalArrayStartin classImmutableCollection<E>
-
internalArrayEnd
int internalArrayEnd()
Description copied from class:ImmutableCollectionIf this collection is backed by an array of its elements in insertion order, returns the offset where this collection's elements end.- Overrides:
internalArrayEndin classImmutableCollection<E>
-
get
public E get(int index)
-
-