T
- Element typepublic class CompositeList<T>
extends java.util.AbstractList<T>
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.
Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.ImmutableList<java.util.List<T>> |
lists |
Modifier | Constructor and Description |
---|---|
private |
CompositeList(com.google.common.collect.ImmutableList<java.util.List<T>> lists)
Creates a CompositeList.
|
Modifier and Type | Method and Description |
---|---|
T |
get(int index) |
static <T> java.util.List<T> |
of()
Creates a CompositeList of zero lists.
|
static <T> CompositeList<T> |
of(java.util.List<? extends T>... lists)
Creates a CompositeList.
|
static <T> CompositeList<T> |
of(java.util.List<? extends T> list0,
java.util.List<? extends T> list1)
Creates a CompositeList of two lists.
|
static <T> CompositeList<T> |
of(java.util.List<? extends T> list0,
java.util.List<? extends T> list1,
java.util.List<? extends T> list2)
Creates a CompositeList of three lists.
|
static <T> java.util.List<T> |
of(java.util.List<T> list0)
Creates a CompositeList of one list.
|
static <T> CompositeList<T> |
ofCopy(java.lang.Iterable<java.util.List<T>> lists)
Creates a CompositeList.
|
int |
size() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private final com.google.common.collect.ImmutableList<java.util.List<T>> lists
private CompositeList(com.google.common.collect.ImmutableList<java.util.List<T>> lists)
lists
- Constituent lists@SafeVarargs public static <T> CompositeList<T> of(java.util.List<? extends T>... lists)
T
- Element typelists
- Constituent listspublic static <T> CompositeList<T> ofCopy(java.lang.Iterable<java.util.List<T>> lists)
T
- Element typelists
- Constituent listspublic static <T> java.util.List<T> of()
T
- Element typepublic static <T> java.util.List<T> of(java.util.List<T> list0)
T
- Element typelist0
- Listpublic static <T> CompositeList<T> of(java.util.List<? extends T> list0, java.util.List<? extends T> list1)
T
- Element typelist0
- First listlist1
- Second listpublic static <T> CompositeList<T> of(java.util.List<? extends T> list0, java.util.List<? extends T> list1, java.util.List<? extends T> list2)
T
- Element typelist0
- First listlist1
- Second listlist2
- Third listpublic T get(int index)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.