Package org.apache.calcite.runtime
Class ConsList<E>
- java.lang.Object
-
- org.apache.calcite.runtime.AbstractImmutableList<E>
-
- org.apache.calcite.runtime.ConsList<E>
-
- Type Parameters:
E
- Element type
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
public class ConsList<E> extends AbstractImmutableList<E>
List that consists of a head element and an immutable non-empty list.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
E
get(int index)
int
hashCode()
int
indexOf(java.lang.Object o)
java.util.Iterator<E>
iterator()
int
lastIndexOf(java.lang.Object o)
java.util.ListIterator<E>
listIterator()
java.util.ListIterator<E>
listIterator(int index)
static <E> java.util.List<E>
of(E first, java.util.List<? extends E> rest)
Creates a ConsList.int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
protected java.util.List<E>
toList()
java.lang.String
toString()
-
Methods inherited from class org.apache.calcite.runtime.AbstractImmutableList
add, add, addAll, addAll, clear, contains, containsAll, isEmpty, remove, remove, removeAll, retainAll, set, subList
-
-
-
-
Method Detail
-
of
public static <E> java.util.List<E> of(E first, java.util.List<? extends E> rest)
Creates a ConsList. It consists of an element pre-pended to another list. If the other list is mutable, creates an immutable copy.
-
get
public E get(int index)
-
size
public int size()
-
hashCode
public int hashCode()
-
equals
public boolean equals(java.lang.Object o)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toList
protected final java.util.List<E> toList()
- Specified by:
toList
in classAbstractImmutableList<E>
-
listIterator
@Nonnull public java.util.ListIterator<E> listIterator()
- Specified by:
listIterator
in interfacejava.util.List<E>
- Overrides:
listIterator
in classAbstractImmutableList<E>
-
iterator
@Nonnull public java.util.Iterator<E> iterator()
-
listIterator
@Nonnull public java.util.ListIterator<E> listIterator(int index)
- Specified by:
listIterator
in interfacejava.util.List<E>
- Overrides:
listIterator
in classAbstractImmutableList<E>
-
toArray
@Nonnull public java.lang.Object[] toArray()
-
toArray
@Nonnull public <T> T[] toArray(@Nonnull T[] a)
-
indexOf
public int indexOf(java.lang.Object o)
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
-
-