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

pack-priv final Class CartesianList<E>

extends AbstractList<List<E>>
implements RandomAccess
Class Inheritance
All Implemented Interfaces
java.util.RandomAccess
Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.base.Preconditions.checkElementIndex

Implementation of Lists#cartesianProduct(List).
Author
Louis Wasserman

Field Summary

Modifier and TypeField and Description
private final transient ImmutableList<List<E>>
private final transient int[]
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
contains(Object
element whose presence in this list is to be tested
object
)

Overrides java.util.AbstractCollection.contains.

Implements java.util.List.contains, java.util.Collection.contains.

Returns true if this list contains the specified element.
pack-priv static <E> List<List<E>>
create(List<? extends List<? extends E>> lists)

public ImmutableList<E>
get(int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.
private int
getAxisIndexForProductIndex(int index, int axis)

public int
indexOf(Object
element to search for
o
)

Overrides java.util.AbstractList.indexOf.

Implements java.util.List.indexOf.

Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
public int
lastIndexOf(Object
element to search for
o
)

Overrides java.util.AbstractList.lastIndexOf.

Implements java.util.List.lastIndexOf.

Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
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.
Inherited from java.util.AbstractList:
addaddaddAllclearequalshashCodeiteratorlistIteratorlistIteratorremoveremoveRangesetsubList

Field Detail

axesback to summary
private final transient ImmutableList<List<E>> axes
axesSizeProductback to summary
private final transient int[] axesSizeProduct

Constructor Detail

CartesianListback to summary
pack-priv CartesianList(ImmutableList<List<E>> axes)

Method Detail

containsback to summary
public boolean contains(Object object)

Overrides java.util.AbstractCollection.contains.

Implements java.util.List.contains, java.util.Collection.contains.

Doc from java.util.List.contains.

Returns true if this list contains the specified element. More formally, returns true if and only if this list contains at least one element e such that Objects.equals(o, e).

Parameters
object:Object

element whose presence in this list is to be tested

Returns:boolean

true if this list contains the specified element

Annotations
@Override
createback to summary
pack-priv static <E> List<List<E>> create(List<? extends List<? extends E>> lists)
getback to summary
public ImmutableList<E> get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.AbstractList.get.

Returns the element at the specified position in this list.

Parameters
index:int

Doc from java.util.List.get.

index of the element to return

Returns:ImmutableList<E>

Doc from java.util.List.get.

the element at the specified position in this list

Annotations
@Override
getAxisIndexForProductIndexback to summary
private int getAxisIndexForProductIndex(int index, int axis)
indexOfback to summary
public int indexOf(Object o)

Overrides java.util.AbstractList.indexOf.

Implements java.util.List.indexOf.

Doc from java.util.AbstractList.indexOf.

Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the lowest index i such that Objects.equals(o, get(i)), or -1 if there is no such index.

Parameters
o:Object

Doc from java.util.List.indexOf.

element to search for

Returns:int

Doc from java.util.List.indexOf.

the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element

Annotations
@Override
lastIndexOfback to summary
public int lastIndexOf(Object o)

Overrides java.util.AbstractList.lastIndexOf.

Implements java.util.List.lastIndexOf.

Doc from java.util.AbstractList.lastIndexOf.

Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the highest index i such that Objects.equals(o, get(i)), or -1 if there is no such index.

Parameters
o:Object

Doc from java.util.List.lastIndexOf.

element to search for

Returns:int

Doc from java.util.List.lastIndexOf.

the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element

Annotations
@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