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:
Serializable
,Iterable<E>
,Collection<E>
,List<E>
,RandomAccess
,SequencedCollection<E>
- Direct Known Subclasses:
ImmutableSortedAsList
An
ImmutableAsList
implementation specialized for when the delegate collection is already
backed by an ImmutableList
or 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
FieldsModifier and TypeFieldDescriptionprivate final ImmutableCollection
<E> private final ImmutableList
<? extends E> Fields inherited from class com.google.common.collect.ImmutableCollection
SPLITERATOR_CHARACTERISTICS
-
Constructor Summary
ConstructorsConstructorDescriptionRegularImmutableAsList
(ImmutableCollection<E> delegate, ImmutableList<? extends E> delegateList) RegularImmutableAsList
(ImmutableCollection<E> delegate, Object[] array) -
Method Summary
Modifier and TypeMethodDescription(package private) int
copyIntoArray
(Object[] dst, int offset) Copies the contents of this immutable collection into the specified array at the specified offset.(package private) ImmutableCollection
<E> (package private) ImmutableList
<? extends E> void
get
(int index) (package private) Object[]
If this collection is backed by an array of its elements in insertion order, returns it.(package private) int
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
If this collection is backed by an array of its elements in insertion order, returns the offset where this collection's elements start.listIterator
(int index) (package private) Object
Methods inherited from class com.google.common.collect.ImmutableAsList
contains, isEmpty, isPartialView, size
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
Methods inherited from class java.util.AbstractCollection
containsAll, 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
-
Field Details
-
delegate
-
delegateList
-
-
Constructor Details
-
RegularImmutableAsList
RegularImmutableAsList(ImmutableCollection<E> delegate, ImmutableList<? extends E> delegateList) -
RegularImmutableAsList
RegularImmutableAsList(ImmutableCollection<E> delegate, Object[] array)
-
-
Method Details
-
delegateCollection
ImmutableCollection<E> delegateCollection()- Specified by:
delegateCollection
in classImmutableAsList<E>
-
delegateList
ImmutableList<? extends E> delegateList() -
listIterator
- Specified by:
listIterator
in interfaceList<E>
- Overrides:
listIterator
in classImmutableList<E>
-
forEach
-
copyIntoArray
Description copied from class:ImmutableCollection
Copies the contents of this immutable collection into the specified array at the specified offset. Returnsoffset + size()
.- Overrides:
copyIntoArray
in classImmutableList<E>
-
internalArray
Description copied from class:ImmutableCollection
If this collection is backed by an array of its elements in insertion order, returns it.- Overrides:
internalArray
in classImmutableCollection<E>
-
internalArrayStart
int internalArrayStart()Description copied from class:ImmutableCollection
If this collection is backed by an array of its elements in insertion order, returns the offset where this collection's elements start.- Overrides:
internalArrayStart
in classImmutableCollection<E>
-
internalArrayEnd
int internalArrayEnd()Description copied from class:ImmutableCollection
If this collection is backed by an array of its elements in insertion order, returns the offset where this collection's elements end.- Overrides:
internalArrayEnd
in classImmutableCollection<E>
-
get
-
writeReplace
Object writeReplace()- Overrides:
writeReplace
in classImmutableAsList<E>
-