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
ConstructorDescriptionTransformingRandomAccessList
(@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, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, 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, stream, toArray
Methods 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:
clear
in interfaceCollection<F>
- Specified by:
clear
in interfaceList<F>
- Overrides:
clear
in classAbstractList<T>
-
get
-
iterator
-
listIterator
- Specified by:
listIterator
in interfaceList<F>
- Overrides:
listIterator
in classAbstractList<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<F>
- Specified by:
isEmpty
in interfaceList<F>
- Overrides:
isEmpty
in classAbstractCollection<T>
-
removeIf
- Specified by:
removeIf
in interfaceCollection<F>
-
remove
-
size
public int size()- Specified by:
size
in interfaceCollection<F>
- Specified by:
size
in interfaceList<F>
- Specified by:
size
in classAbstractCollection<T>
-
set
-
add
-