Package io.papermc.paper.util
Class TransformingRandomAccessList<F,T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<T>
io.papermc.paper.util.TransformingRandomAccessList<F,T>
- Type Parameters:
F- backing list element typeT- transformed list element type
- All Implemented Interfaces:
Iterable<T>,Collection<T>,List<T>,RandomAccess
public final class TransformingRandomAccessList<F,T>
extends AbstractList<T>
implements RandomAccess
Modified version of the Guava class with the same name to support add operations.
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionTransformingRandomAccessList(@NonNull List<F> fromList, @NonNull Function<? super F, ? extends T> toFunction, @NonNull Function<? super T, ? extends F> fromFunction) Create a newTransformingRandomAccessList. -
Method Summary
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
addAll, contains, containsAll, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
TransformingRandomAccessList
public TransformingRandomAccessList(@NonNull List<F> fromList, @NonNull Function<? super F, ? extends T> toFunction, @NonNull Function<? super T, ? extends F> fromFunction) Create a newTransformingRandomAccessList.- Parameters:
fromList- backing listtoFunction- function mapping backing list element type to transformed list element typefromFunction- function mapping transformed list element type to backing list element type
-
-
Method Details
-
clear
public void clear()- Specified by:
clearin interfaceCollection<F>- Specified by:
clearin interfaceList<F>- Overrides:
clearin classAbstractList<T>
-
get
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<F>- Overrides:
listIteratorin classAbstractList<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<F>- Specified by:
isEmptyin interfaceList<F>- Overrides:
isEmptyin classAbstractCollection<T>
-
removeIf
- Specified by:
removeIfin interfaceCollection<F>
-
remove
-
size
public int size()- Specified by:
sizein interfaceCollection<F>- Specified by:
sizein interfaceList<F>- Specified by:
sizein classAbstractCollection<T>
-
set
-
add
-