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, setadd, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subListaddAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitprivate 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()