Package org.apache.calcite.runtime
Class FlatLists.Flat3List<T>
- java.lang.Object
-
- org.apache.calcite.runtime.AbstractImmutableList<T>
-
- org.apache.calcite.runtime.FlatLists.AbstractFlatList<T>
-
- org.apache.calcite.runtime.FlatLists.Flat3List<T>
-
- Type Parameters:
T
- Element type
- All Implemented Interfaces:
java.lang.Comparable<java.util.List>
,java.lang.Iterable<T>
,java.util.Collection<T>
,java.util.List<T>
,java.util.RandomAccess
,FlatLists.ComparableList<T>
- Enclosing class:
- FlatLists
protected static class FlatLists.Flat3List<T> extends FlatLists.AbstractFlatList<T> implements FlatLists.ComparableList<T>
List that stores its three elements in the three members of the class. UnlikeArrayList
orArrays.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<T>
append(T e)
Returns a list that consists of a this list's elements plus a given element.int
compareTo(java.util.List o)
boolean
equals(java.lang.Object o)
T
get(int index)
int
hashCode()
int
indexOf(java.lang.Object o)
java.util.Iterator<T>
iterator()
int
lastIndexOf(java.lang.Object o)
int
size()
java.lang.Object[]
toArray()
<T2> T2[]
toArray(T2[] a)
java.lang.String
toString()
-
Methods inherited from class org.apache.calcite.runtime.FlatLists.AbstractFlatList
toList
-
Methods inherited from class org.apache.calcite.runtime.AbstractImmutableList
add, add, addAll, addAll, clear, contains, containsAll, isEmpty, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList
-
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
size
public int size()
-
iterator
public java.util.Iterator<T> iterator()
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOf
in interfacejava.util.List<T>
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOf
in interfacejava.util.List<T>
-
toArray
public <T2> T2[] toArray(T2[] a)
-
toArray
public java.lang.Object[] toArray()
-
compareTo
public int compareTo(java.util.List o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<T>
-
append
public java.util.List<T> append(T e)
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>
-
-