Class ReverseList<A>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<A>
eu.bandm.tools.ramus.runtime2.ReverseList<A>
Type Parameters:
A - The type of list elements
All Implemented Interfaces:
Iterable<A>, Collection<A>, List<A>

public class ReverseList<A> extends AbstractList<A>
Generic, immutable, reverse single-linked lists.

Instances of this class are called reverse lists in the documentation. This does not refer to the order of their elements, but rather to the fact that they are held together by chains of references from back to front.

Reverse lists are optimized for incremental front-to-back construction; the append(A) operation is fast. By contrast, both random access to individual elements (get(int)) and traversal of all elements (AbstractList.iterator()) are relatively slow. Making a copy to a read-optimized data structure (snapshot()) is recommended.