Package org.cyclos.utils
Class TransformedList<S,T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- org.cyclos.utils.TransformedList<S,T>
-
- Type Parameters:
S- The source element typeT- The target element type
- All Implemented Interfaces:
Iterable<T>,Collection<T>,List<T>
public class TransformedList<S,T> extends AbstractList<T>
A read-only view of a list, transforming elements on get. Doesn't supportindexOf(Object)andlastIndexOf(Object), because they would need to compare the transformed versions of the original list.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget(int index)intindexOf(Object o)intlastIndexOf(Object o)intsize()List<T>subList(int fromIndex, int toIndex)-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, iterator, listIterator, listIterator, remove, removeRange, set
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, 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, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
get
public T get(int index)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<S>- Overrides:
lastIndexOfin classAbstractList<T>
-
size
public int size()
- Specified by:
sizein interfaceCollection<S>- Specified by:
sizein interfaceList<S>- Specified by:
sizein classAbstractCollection<T>
-
-