|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object endrov.util.collection.PersistentSLinkedList<E>
public class PersistentSLinkedList<E>
Persistent singly linked list. Persistent means that the list is never modified. This only holds true for the list itself; the elements it points to can be modified by the user. The empty list is the value null.
Field Summary | |
---|---|
PersistentSLinkedList<E> |
next
|
Constructor Summary | |
---|---|
PersistentSLinkedList(E e)
Construct list with single element O(1) |
|
PersistentSLinkedList(E a,
PersistentSLinkedList<E> next)
Construct a:b O(1) |
Method Summary | ||
---|---|---|
static
|
cons(E a,
PersistentSLinkedList<E> b)
Construct a:b O(1) |
|
E |
head()
Return the first element O(1) |
|
java.util.Iterator<E> |
iterator()
Iterate over list. |
|
static
|
size(PersistentSLinkedList<E> node)
Number of elements O(n) |
|
PersistentSLinkedList<E> |
tail()
Return list of following elements O(1) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public PersistentSLinkedList<E> next
Constructor Detail |
---|
public PersistentSLinkedList(E e)
public PersistentSLinkedList(E a, PersistentSLinkedList<E> next)
Method Detail |
---|
public static <E> int size(PersistentSLinkedList<E> node)
public E head()
public PersistentSLinkedList<E> tail()
public static <E> PersistentSLinkedList<E> cons(E a, PersistentSLinkedList<E> b)
public java.util.Iterator<E> iterator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |