Package org.apache.calcite.runtime
Class FlatLists.Flat4List<T>
java.lang.Object
org.apache.calcite.runtime.FlatLists.AbstractFlatList<T>
org.apache.calcite.runtime.FlatLists.Flat4List<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.Flat4List<T>
extends FlatLists.AbstractFlatList<T>
implements FlatLists.ComparableList<T>
List that stores its four elements in the four 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, cannot be modified or re-sized. The elements may be null.
The list is created via FlatLists.of(java.util.List)
.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection<? extends T> c) boolean
addAll
(Collection<? extends T> c) Returns a list that consists of a this list's elements plus a given element.void
clear()
int
boolean
boolean
containsAll
(Collection<?> c) boolean
get
(int index) int
hashCode()
int
boolean
isEmpty()
iterator()
int
lastIndexOf
(@Nullable Object o) listIterator
(int index) remove
(int index) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
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
toList
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
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:
lastIndexOf
in interfaceList<T>
-
toArray
public <T2> @Nullable T2[] toArray(T2 @Nullable [] a) -
toArray
-
compareTo
- Specified by:
compareTo
in interfaceComparable<T>
-
append
Description copied from class:FlatLists.AbstractFlatList
Returns a list that consists of a this list's elements plus a given element.- Specified by:
append
in classFlatLists.AbstractFlatList<T>
-
listIterator
- Specified by:
listIterator
in interfaceList<E>
-
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
-
listIterator
- Specified by:
listIterator
in interfaceList<E>
-
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>
-