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

pack-priv Class RegularImmutableList<E>

extends ImmutableList<E>
Class Inheritance
Annotations
@GwtCompatible
serializable:true
emulated:true
@SuppressWarnings:serial
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, .VisibleForTesting, java.util.Spliterator, .Spliterators, org.checkerframework.checker.nullness.qual.Nullable

Implementation of ImmutableList backed by a simple array.
Author
Kevin Bourrillion

Field Summary

Modifier and TypeField and Description
pack-priv final transient Object[]
pack-priv static final ImmutableList<Object>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

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

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.
pack-priv boolean
isPartialView()

Implements abstract com.google.common.collect.ImmutableCollection.isPartialView.

Returns true if this immutable collection's implementation contains references to user-created objects that aren't accessible via this collection's methods.
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.
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.
public Spliterator<E>
Inherited from com.google.common.collect.ImmutableList:
addaddAllasImmutableListasImmutableListasListbuilderbuilderWithExpectedSizecontainscopyIntoArraycopyOfcopyOfcopyOfcopyOfequalsforEachhashCodeindexOfiteratorlastIndexOflistIteratorofofofofofofofofofofofofofremovereplaceAllreversesetsortsortedCopyOfsortedCopyOfsubListsubListUncheckedtoImmutableListwriteReplace

Field Detail

arrayback to summary
pack-priv final transient Object[] array
Annotations
@VisibleForTesting
EMPTYback to summary
pack-priv static final ImmutableList<Object> EMPTY

Constructor Detail

RegularImmutableListback to summary
pack-priv RegularImmutableList(Object[] array)

Method Detail

copyIntoArrayback to summary
pack-priv int copyIntoArray(@Nullable Object[] dst, int dstOff)
Annotations
@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
@SuppressWarnings:unchecked
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
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
isPartialViewback to summary
pack-priv boolean isPartialView()

Implements abstract com.google.common.collect.ImmutableCollection.isPartialView.

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

Returns true if this immutable collection's implementation contains references to user-created objects that aren't accessible via this collection's methods. This is generally used to determine whether copyOf implementations should make an explicit copy to avoid memory leaks.

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
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

Annotations
@Override
spliteratorback to summary
public Spliterator<E> spliterator()

Overrides com.google.common.collect.ImmutableList.spliterator.

Overrides default java.util.List.spliterator, java.util.Collection.spliterator.

Doc from java.util.List.spliterator.

Creates a Spliterator over the elements in this list.

The Spliterator reports Spliterator#SIZED and Spliterator#ORDERED. Implementations should document the reporting of additional characteristic values.

Returns:Spliterator<E>

a Spliterator over the elements in this list

Annotations
@Override