Package org.apache.calcite.util
Class CompositeList<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<T>
org.apache.calcite.util.CompositeList<T>
- Type Parameters:
T
- Element type
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,List<T>
Read-only list that is the concatenation of sub-lists.
The list is read-only; attempts to call methods such as
AbstractList.add(Object)
or AbstractList.set(int, Object)
will throw.
Changes to the backing lists, including changes in length, will be reflected in this list.
This class is not thread-safe. Changes to backing lists will cause unspecified behavior.
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Method Summary
Modifier and TypeMethodDescriptionget
(int index) static <T> List<T>
of()
Creates a CompositeList of zero lists.static <T> CompositeList<T>
Creates a CompositeList.static <T> CompositeList<T>
Creates a CompositeList of two lists.static <T> CompositeList<T>
Creates a CompositeList of three lists.static <T> List<T>
Creates a CompositeList of one list.static <T> CompositeList<T>
Creates a CompositeList.int
size()
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, 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
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Method Details
-
of
Creates a CompositeList.- Type Parameters:
T
- Element type- Parameters:
lists
- Constituent lists- Returns:
- List consisting of all lists
-
ofCopy
Creates a CompositeList.- Type Parameters:
T
- Element type- Parameters:
lists
- Constituent lists- Returns:
- List consisting of all lists
-
of
Creates a CompositeList of zero lists.- Type Parameters:
T
- Element type- Returns:
- List consisting of all lists
-
of
Creates a CompositeList of one list.- Type Parameters:
T
- Element type- Parameters:
list0
- List- Returns:
- List consisting of all lists
-
of
Creates a CompositeList of two lists.- Type Parameters:
T
- Element type- Parameters:
list0
- First listlist1
- Second list- Returns:
- List consisting of all lists
-
of
public static <T> CompositeList<T> of(List<? extends T> list0, List<? extends T> list1, List<? extends T> list2) Creates a CompositeList of three lists.- Type Parameters:
T
- Element type- Parameters:
list0
- First listlist1
- Second listlist2
- Third list- Returns:
- List consisting of all lists
-
get
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceList<T>
- Specified by:
size
in classAbstractCollection<T>
-