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>
AnImmutableAsList
implementation specialized for when the delegate collection is already backed by anImmutableList
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
-
Nested classes/interfaces inherited from class com.google.common.collect.ImmutableCollection
ImmutableCollection.ArrayBasedBuilder<E>
-
-
Field Summary
Fields Modifier and Type Field Description private ImmutableCollection<E>
delegate
private ImmutableList<? extends E>
delegateList
-
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) 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()
E
get(int index)
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, copyOf, copyOf, copyOf, copyOf, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, of, remove, reverse, set, subList, subListUnchecked
-
Methods inherited from class com.google.common.collect.ImmutableCollection
add, addAll, clear, remove, removeAll, 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:
delegateCollection
in classImmutableAsList<E>
-
delegateList
ImmutableList<? extends E> delegateList()
-
listIterator
public UnmodifiableListIterator<E> listIterator(int index)
- Specified by:
listIterator
in interfacejava.util.List<E>
- Overrides:
listIterator
in classImmutableList<E>
-
copyIntoArray
@GwtIncompatible int copyIntoArray(java.lang.Object[] dst, int offset)
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>
-
get
public E get(int index)
-
-