Class ConcatenatedListView<T>
java.lang.Object
net.neoforged.neoforge.common.util.ConcatenatedListView<T>
- All Implemented Interfaces:
Iterable<T>, Collection<T>, List<T>, SequencedCollection<T>
A list that concatenates multiple other lists for efficient iteration.
You may use this in place of creating a new list and calling
List.addAll(Collection)
for each of your collections.
This list does not support modification operations, but the underlying lists may be mutated safely externally.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConcatenatedListView(List<? extends List<? extends T>> lists) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends T> c) booleanaddAll(Collection<? extends T> c) voidclear()private <C extends Collection<T>>
Cconcatenate(Supplier<C> collectionFactory) booleanbooleancontainsAll(Collection<?> c) get(int index) intbooleanisEmpty()iterator()intlistIterator(int index) static <T> List<T> static <T> ConcatenatedListView<T> remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()subList(int fromIndex, int toIndex) Object[]toArray()<T1> T1[]toArray(T1[] a) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort
-
Field Details
-
lists
-
-
Constructor Details
-
ConcatenatedListView
-
-
Method Details
-
of
-
of
-
size
-
isEmpty
-
contains
-
get
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<T>
-
iterator
-
spliterator
- Specified by:
spliteratorin interfaceCollection<T>- Specified by:
spliteratorin interfaceIterable<T>- Specified by:
spliteratorin interfaceList<T>
-
concatenate
-
toArray
-
toArray
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceList<T>
-
add
-
add
-
set
-
addAll
-
addAll
-
remove
-
remove
-
removeAll
-
retainAll
-
clear
-
listIterator
- Specified by:
listIteratorin interfaceList<T>
-
listIterator
- Specified by:
listIteratorin interfaceList<T>
-
subList
-