Package org.apache.calcite.runtime
Class FlatLists
java.lang.Object
org.apache.calcite.runtime.FlatLists
Space-efficient, comparable, immutable lists.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Base class for flat lists.static interface
List that is also comparable.protected static class
List that stores its one elements in the one members of the class.protected static class
List that stores its two elements in the two members of the class.protected static class
List that stores its three elements in the three members of the class.protected static class
List that stores its four elements in the four members of the class.protected static class
List that stores its five elements in the five members of the class.protected static class
List that stores its six elements in the six members of the class. -
Field Summary
Modifier and TypeFieldDescriptionstatic final org.apache.calcite.runtime.FlatLists.ComparableEmptyList
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> com.google.common.collect.ImmutableList<E>
append
(com.google.common.collect.ImmutableList<E> list, E e) Returns a list that consists of a given list plus an element, guaranteed to be anImmutableList
.static <E> List<E>
Returns a list that consists of a given list plus an element.static <K,
V> com.google.common.collect.ImmutableMap<K, V> Returns a map that consists of a given map plus an (key, value), guaranteed to be anImmutableMap
.static <T> List<T>
copy
(T... t) Deprecated.static <T extends Comparable>
List<T>copyOf
(T... t) Creates a memory-, CPU- and cache-efficient comparable immutable list, always copying the contents.static <T> FlatLists.ComparableList<T>
of()
Creates a flat list with 0 elements.static <T> List<T>
Creates a memory-, CPU- and cache-efficient immutable list from an existing list.static <T> List<T>
of
(T t0) Creates a flat list with 1 element.static <T extends Comparable>
List<T>of
(T... t) Creates a memory-, CPU- and cache-efficient immutable list.static <T> List<T>
of
(T t0, T t1) Creates a flat list with 2 elements.static <T> List<T>
of
(T t0, T t1, T t2) Creates a flat list with 3 elements.static <T> List<T>
of
(T t0, T t1, T t2, T t3) Creates a flat list with 4 elements.static <T> List<T>
of
(T t0, T t1, T t2, T t3, T t4) Creates a flat list with 6 elements.static <T> List<T>
of
(T t0, T t1, T t2, T t3, T t4, T t5) Creates a flat list with 6 elements.static <T extends Comparable>
FlatLists.ComparableList<T>ofComparable
(List<T> t)
-
Field Details
-
COMPARABLE_EMPTY_LIST
public static final org.apache.calcite.runtime.FlatLists.ComparableEmptyList COMPARABLE_EMPTY_LIST
-
-
Method Details
-
of
Creates a flat list with 0 elements. -
of
Creates a flat list with 1 element. -
of
Creates a flat list with 2 elements. -
of
Creates a flat list with 3 elements. -
of
Creates a flat list with 4 elements. -
of
Creates a flat list with 6 elements. -
of
Creates a flat list with 6 elements. -
of
Creates a memory-, CPU- and cache-efficient immutable list.- Type Parameters:
T
- Element type- Parameters:
t
- Array of members of list- Returns:
- List containing the given members
-
copy
Deprecated.Creates a memory-, CPU- and cache-efficient immutable list, always copying the contents.- Type Parameters:
T
- Element type- Parameters:
t
- Array of members of list- Returns:
- List containing the given members
-
copyOf
Creates a memory-, CPU- and cache-efficient comparable immutable list, always copying the contents.The elements are comparable, and so is the returned list. Elements may be null.
- Type Parameters:
T
- Element type- Parameters:
t
- Array of members of list- Returns:
- List containing the given members
-
copyOf
Creates a memory-, CPU- and cache-efficient immutable list, always copying the contents.The elements need not be comparable, and the returned list may not implement
Comparable
. Elements may be null.- Type Parameters:
T
- Element type- Parameters:
t
- Array of members of list- Returns:
- List containing the given members
-
of
Creates a memory-, CPU- and cache-efficient immutable list from an existing list. The list is always copied.- Type Parameters:
T
- Element type- Parameters:
t
- Array of members of list- Returns:
- List containing the given members
-
ofComparable
-
append
Returns a list that consists of a given list plus an element. -
append
public static <E> com.google.common.collect.ImmutableList<E> append(com.google.common.collect.ImmutableList<E> list, E e) Returns a list that consists of a given list plus an element, guaranteed to be anImmutableList
. -
append
Returns a map that consists of a given map plus an (key, value), guaranteed to be anImmutableMap
.
-