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 boolean
equals(Object o)
E
get(int index)
int
hashCode()
static <E> ReversedUnmodifiableListView<E>
of(List<E> delegate)
Creates a new unmodifiable view of the given list with a reversed order.int
size()
-
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:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceList<E>
- Specified by:
size
in classAbstractCollection<E>
-
equals
public boolean equals(Object o)
- Specified by:
equals
in interfaceCollection<E>
- Specified by:
equals
in interfaceList<E>
- Overrides:
equals
in classAbstractList<E>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceCollection<E>
- Specified by:
hashCode
in interfaceList<E>
- Overrides:
hashCode
in classAbstractList<E>
-
-