Package net.minecraftforge.common.util
Class ConcatenatedListView<T>
java.lang.Object
net.minecraftforge.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
-
Constructor Summary
ModifierConstructorDescriptionprivate
ConcatenatedListView
(List<? extends List<? extends T>> lists) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, @NotNull Collection<? extends T> c) boolean
addAll
(@NotNull Collection<? extends T> c) void
clear()
private <C extends Collection<T>>
Cconcatenate
(Supplier<C> collectionFactory) boolean
boolean
containsAll
(@NotNull Collection<?> c) get
(int index) int
boolean
isEmpty()
iterator()
int
@NotNull ListIterator
<T> @NotNull ListIterator
<T> listIterator
(int index) static <T> List
<T> static <T> ConcatenatedListView
<T> remove
(int index) boolean
boolean
removeAll
(@NotNull Collection<?> c) boolean
retainAll
(@NotNull Collection<?> c) int
size()
subList
(int fromIndex, int toIndex) @NotNull Object[]
toArray()
<T1> T1[]
toArray
(T1[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort
-
Field Details
-
lists
-
-
Constructor Details
-
ConcatenatedListView
-
-
Method Details
-
of
-
of
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
get
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<T>
-
iterator
-
spliterator
- Specified by:
spliterator
in interfaceCollection<T>
- Specified by:
spliterator
in interfaceIterable<T>
- Specified by:
spliterator
in interfaceList<T>
-
concatenate
-
toArray
-
toArray
@NotNull public <T1> T1[] toArray(@NotNull T1[] a) -
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceList<T>
-
add
-
add
-
set
-
addAll
-
addAll
-
remove
-
remove
-
removeAll
-
retainAll
-
clear
public void clear() -
listIterator
- Specified by:
listIterator
in interfaceList<T>
-
listIterator
- Specified by:
listIterator
in interfaceList<T>
-
subList
-