public class ImmutableLinkedList<T>
extends java.util.AbstractSequentialList<T>
Modifier and Type | Class and Description |
---|---|
private static class |
ImmutableLinkedList.IllIterator<T> |
Modifier and Type | Field and Description |
---|---|
private T |
head |
private static ImmutableLinkedList<java.lang.Object> |
NIL |
private ImmutableLinkedList<T> |
tail |
Modifier | Constructor and Description |
---|---|
private |
ImmutableLinkedList() |
|
ImmutableLinkedList(T head,
ImmutableLinkedList<T> tail) |
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
equal(ImmutableLinkedList<T> a,
ImmutableLinkedList<T> b) |
static int |
hashCode(ImmutableLinkedList<?> list) |
T |
head() |
boolean |
isEmpty() |
T |
last() |
java.util.ListIterator<T> |
listIterator(int index) |
static <T> ImmutableLinkedList<T> |
nil() |
ImmutableLinkedList<T> |
prepend(T object) |
ImmutableLinkedList<T> |
reverse() |
int |
size() |
ImmutableLinkedList<T> |
tail() |
add, addAll, get, iterator, remove, set
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private static final ImmutableLinkedList<java.lang.Object> NIL
private final T head
private final ImmutableLinkedList<T> tail
private ImmutableLinkedList()
public ImmutableLinkedList(T head, ImmutableLinkedList<T> tail)
public static <T> ImmutableLinkedList<T> nil()
public T head()
public ImmutableLinkedList<T> tail()
public T last()
public ImmutableLinkedList<T> prepend(T object)
public ImmutableLinkedList<T> reverse()
public static <T> boolean equal(ImmutableLinkedList<T> a, ImmutableLinkedList<T> b)
public static int hashCode(ImmutableLinkedList<?> list)
public java.util.ListIterator<T> listIterator(int index)
public boolean isEmpty()