Package org.apache.calcite.runtime
Class ConsList<E>
java.lang.Object
org.apache.calcite.runtime.ConsList<E>
- Type Parameters:
E
- Element type
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,List<E>
List that consists of a head element and an immutable non-empty list.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection<? extends E> c) boolean
addAll
(Collection<? extends E> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
get
(int index) int
hashCode()
int
boolean
isEmpty()
iterator()
int
lastIndexOf
(@Nullable Object o) listIterator
(int index) static <E> List<E>
Creates a ConsList.remove
(int index) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
subList
(int fromIndex, int toIndex) @PolyNull Object[]
toArray()
<T> @Nullable T[]
toArray
(T @Nullable [] a) toList()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Method Details
-
of
Creates a ConsList. It consists of an element pre-pended to another list. If the other list is mutable, creates an immutable copy. -
get
-
size
public int size() -
hashCode
public int hashCode() -
equals
-
toString
-
toList
-
listIterator
- Specified by:
listIterator
in interfaceList<E>
-
iterator
-
listIterator
- Specified by:
listIterator
in interfaceList<E>
-
toArray
-
toArray
public <T> @Nullable T[] toArray(T @Nullable [] a) -
indexOf
-
lastIndexOf
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<E>
- Specified by:
isEmpty
in interfaceList<E>
-
add
- Specified by:
add
in interfaceCollection<E>
- Specified by:
add
in interfaceList<E>
-
addAll
- Specified by:
addAll
in interfaceCollection<E>
- Specified by:
addAll
in interfaceList<E>
-
addAll
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E>
- Specified by:
removeAll
in interfaceList<E>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E>
- Specified by:
retainAll
in interfaceList<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in interfaceList<E>
-
set
-
add
-
remove
-
subList
-
contains
- Specified by:
contains
in interfaceCollection<E>
- Specified by:
contains
in interfaceList<E>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceList<E>
-
remove
- Specified by:
remove
in interfaceCollection<E>
- Specified by:
remove
in interfaceList<E>
-