Class ReversedUnmodifiableListView<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- de.rwth.swc.coffee4j.engine.process.util.ReversedUnmodifiableListView<E>
-
- Type Parameters:
E- the type of the list elements
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>
public class ReversedUnmodifiableListView<E> extends AbstractList<E>
Simple view of a list which reverses the order of the elements. Can be used to iterate over a list in reverse order.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Eget(int index)inthashCode()static <E> ReversedUnmodifiableListView<E>of(List<E> delegate)Creates a new unmodifiable view of the given list with a reversed order.intsize()-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
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
-
of
public static <E> ReversedUnmodifiableListView<E> of(List<E> delegate)
Creates a new unmodifiable view of the given list with a reversed order.- Type Parameters:
E- the type of the list elements- Parameters:
delegate- to which all calls are delegated with a reversed index- Returns:
- the view
-
get
public E get(int index)
-
size
public int size()
- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classAbstractCollection<E>
-
equals
public boolean equals(Object o)
- Specified by:
equalsin interfaceCollection<E>- Specified by:
equalsin interfaceList<E>- Overrides:
equalsin classAbstractList<E>
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<E>- Specified by:
hashCodein interfaceList<E>- Overrides:
hashCodein classAbstractList<E>
-
-