Package io.papermc.paper.util
Class TransformingRandomAccessList<F,T>
java.lang.Object
java.util.AbstractCollection<T>
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
,SequencedCollection<T>
@NullMarked
@Internal
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
(List<F> fromList, Function<? super F, ? extends T> toFunction, 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, addFirst, addLast, contains, containsAll, getFirst, getLast, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
-
Constructor Details
-
TransformingRandomAccessList
public TransformingRandomAccessList(List<F> fromList, Function<? super F, ? extends T> toFunction, 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
-