public class ImmutableLinkedList<T> extends AbstractSequentialList<T>
modCount
Constructor and Description |
---|
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() |
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
addAll, contains, containsAll, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
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 ListIterator<T> listIterator(int index)
listIterator
in interface List<T>
listIterator
in class AbstractSequentialList<T>
public boolean isEmpty()
isEmpty
in interface Collection<T>
isEmpty
in interface List<T>
isEmpty
in class AbstractCollection<T>
public int size()
size
in interface Collection<T>
size
in interface List<T>
size
in class AbstractCollection<T>
Copyright © 2020. All rights reserved.