Package org.apache.calcite.runtime
Class FlatLists.Flat2List<T>
java.lang.Object
org.apache.calcite.runtime.FlatLists.AbstractFlatList<T>
org.apache.calcite.runtime.FlatLists.Flat2List<T>
- Type Parameters:
T- Element type
- All Implemented Interfaces:
Comparable<List>,Iterable<T>,Collection<T>,List<T>,RandomAccess,FlatLists.ComparableList<T>
- Enclosing class:
FlatLists
protected static class FlatLists.Flat2List<T>
extends FlatLists.AbstractFlatList<T>
implements FlatLists.ComparableList<T>
List that stores its two elements in the two members of the class.
Unlike
ArrayList or
Arrays.asList(Object[]) there is
no array, only one piece of memory allocated, therefore is very compact
and cache and CPU efficient.
The list is read-only and cannot be modified or re-sized. The elements may be null.
The list is created via FlatLists.of().
-
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends T> c) booleanaddAll(Collection<? extends T> c) Returns a list that consists of a this list's elements plus a given element.voidclear()intbooleanbooleancontainsAll(Collection<?> c) booleanget(int index) inthashCode()intbooleanisEmpty()iterator()intlastIndexOf(@Nullable Object o) listIterator(int index) remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()subList(int fromIndex, int toIndex) @PolyNull Object[]toArray()<T2> @Nullable T2[]toArray(T2 @Nullable [] a) toString()Methods inherited from class org.apache.calcite.runtime.FlatLists.AbstractFlatList
toListMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, isEmpty, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList
-
Method Details
-
toString
-
get
-
size
public int size() -
iterator
-
equals
-
hashCode
public int hashCode() -
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<T>
-
toArray
public <T2> @Nullable T2[] toArray(T2 @Nullable [] a) -
toArray
-
compareTo
- Specified by:
compareToin interfaceComparable<T>
-
append
Description copied from class:FlatLists.AbstractFlatListReturns a list that consists of a this list's elements plus a given element.- Specified by:
appendin classFlatLists.AbstractFlatList<T>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceList<E>
-
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceList<E>
-
addAll
- Specified by:
addAllin interfaceCollection<E>- Specified by:
addAllin interfaceList<E>
-
addAll
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Specified by:
removeAllin interfaceList<E>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>- Specified by:
retainAllin interfaceList<E>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceList<E>
-
set
-
add
-
remove
-
listIterator
- Specified by:
listIteratorin interfaceList<E>
-
subList
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceList<E>
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>
-
remove
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceList<E>
-