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 long
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget
(int index) boolean
isEmpty()
iterator()
listIterator
(int index) remove
(int index) boolean
protected void
removeRange
(int fromIndex, int toIndex) The default implementation inherited is based on iteration and removal of each element which can be overkill.int
size()
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, set, 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
-
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:
removeRange
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>
-