Package com.google.common.collect
Class Lists.TransformingRandomAccessList<F,T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
com.google.common.collect.Lists.TransformingRandomAccessList<F,T>
- All Implemented Interfaces:
Serializable,Iterable<T>,Collection<T>,List<T>,RandomAccess,SequencedCollection<T>
- Enclosing class:
Lists
private static class Lists.TransformingRandomAccessList<F,T>
extends AbstractList<T>
implements RandomAccess, Serializable
Implementation of a transforming random access list. We try to make as many of these methods
pass-through to the source list as possible so that the performance characteristics of the
source list and transformed list are similar.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(int index) booleanisEmpty()iterator()listIterator(int index) remove(int index) booleanprotected voidremoveRange(int fromIndex, int toIndex) The default implementation inherited is based on iteration and removal of each element which can be overkill.intsize()Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, set, 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, addFirst, addLast, contains, containsAll, getFirst, getLast, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
-
Field Details
-
fromList
-
function
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
TransformingRandomAccessList
-
-
Method Details
-
removeRange
protected void removeRange(int fromIndex, int toIndex) The default implementation inherited is based on iteration and removal of each element which can be overkill. That's why we forward this call directly to the backing list.- Overrides:
removeRangein 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>
-