Top Description Fields Constructors Methods
com.google.common.collect

pack-priv Class RegularImmutableAsList<E>

extends ImmutableAsList<E>
Class Inheritance
Known Direct Subclasses
com.google.common.collect.ImmutableSortedAsList
Annotations
@GwtCompatible
emulated:true
@SuppressWarnings:serial
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, .GwtIncompatible, java.util.function.Consumer, javax.annotation.CheckForNull, org.checkerframework.checker.nullness.qual.Nullable

An ImmutableAsList implementation specialized for when the delegate collection is already backed by an ImmutableList or array.
Author
Louis Wasserman

Field Summary

Modifier and TypeField and Description
private final ImmutableCollection<E>
private final ImmutableList<? extends E>

Constructor Summary

AccessConstructor and Description
pack-priv
RegularImmutableAsList(ImmutableCollection<E> delegate, ImmutableList<? extends E> delegateList)

pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv int
copyIntoArray(@Nullable Object[] dst, int offset)

pack-priv ImmutableCollection<E>
pack-priv ImmutableList<? extends E>
public void
forEach(Consumer<? super E>
The action to be performed for each element
action
)

Overrides com.google.common.collect.ImmutableList.forEach.

Overrides default java.lang.Iterable.forEach.

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.
public E
get(int
index of the element to return
index
)

Implements java.util.List.get.

Returns the element at the specified position in this list.
pack-priv Object[]
internalArray()

Overrides com.google.common.collect.ImmutableCollection.internalArray.

If this collection is backed by an array of its elements in insertion order, returns it.
pack-priv int
internalArrayEnd()

Overrides com.google.common.collect.ImmutableCollection.internalArrayEnd.

If this collection is backed by an array of its elements in insertion order, returns the offset where this collection's elements end.
pack-priv int
internalArrayStart()

Overrides com.google.common.collect.ImmutableCollection.internalArrayStart.

If this collection is backed by an array of its elements in insertion order, returns the offset where this collection's elements start.
public UnmodifiableListIterator<E>
listIterator(int
index of the first element to be returned from the list iterator (by a call to next)
index
)

Overrides com.google.common.collect.ImmutableList.listIterator.

Implements java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
Inherited from com.google.common.collect.ImmutableAsList:
containsisEmptyisPartialViewsizewriteReplace

Field Detail

delegateback to summary
private final ImmutableCollection<E> delegate
delegateListback to summary
private final ImmutableList<? extends E> delegateList

Constructor Detail

RegularImmutableAsListback to summary
pack-priv RegularImmutableAsList(ImmutableCollection<E> delegate, ImmutableList<? extends E> delegateList)
RegularImmutableAsListback to summary
pack-priv RegularImmutableAsList(ImmutableCollection<E> delegate, Object[] array)

Method Detail

copyIntoArrayback to summary
pack-priv int copyIntoArray(@Nullable Object[] dst, int offset)
Annotations
@GwtIncompatible
@Override
delegateCollectionback to summary
pack-priv ImmutableCollection<E> delegateCollection()

Implements abstract com.google.common.collect.ImmutableAsList.delegateCollection.

Annotations
@Override
delegateListback to summary
pack-priv ImmutableList<? extends E> delegateList()
forEachback to summary
public void forEach(Consumer<? super E> action)

Overrides com.google.common.collect.ImmutableList.forEach.

Overrides default java.lang.Iterable.forEach.

Doc from java.lang.Iterable.forEach.

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.

The behavior of this method is unspecified if the action performs side-effects that modify the underlying source of elements, unless an overriding class has specified a concurrent modification policy.

Parameters
action:Consumer<? super E>

The action to be performed for each element

Annotations
@GwtIncompatible
@Override
getback to summary
public E get(int index)

Implements java.util.List.get.

Doc from java.util.List.get.

Returns the element at the specified position in this list.

Parameters
index:int

index of the element to return

Returns:E

the element at the specified position in this list

Annotations
@Override
internalArrayback to summary
pack-priv Object[] internalArray()

Overrides com.google.common.collect.ImmutableCollection.internalArray.

Doc from com.google.common.collect.ImmutableCollection.internalArray.

If this collection is backed by an array of its elements in insertion order, returns it.

Annotations
@Override
@CheckForNull
internalArrayEndback to summary
pack-priv int internalArrayEnd()

Overrides com.google.common.collect.ImmutableCollection.internalArrayEnd.

Doc from com.google.common.collect.ImmutableCollection.internalArrayEnd.

If this collection is backed by an array of its elements in insertion order, returns the offset where this collection's elements end.

Annotations
@Override
internalArrayStartback to summary
pack-priv int internalArrayStart()

Overrides com.google.common.collect.ImmutableCollection.internalArrayStart.

Doc from com.google.common.collect.ImmutableCollection.internalArrayStart.

If this collection is backed by an array of its elements in insertion order, returns the offset where this collection's elements start.

Annotations
@Override
listIteratorback to summary
public UnmodifiableListIterator<E> listIterator(int index)

Overrides com.google.common.collect.ImmutableList.listIterator.

Implements java.util.List.listIterator.

Doc from java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list. The specified index indicates the first element that would be returned by an initial call to next. An initial call to previous would return the element with the specified index minus one.

Parameters
index:int

index of the first element to be returned from the list iterator (by a call to next)

Returns:UnmodifiableListIterator<E>

a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list

Annotations
@SuppressWarnings:unchecked
@Override