org.parboiled.common
Class ImmutableLinkedList<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<T>
org.parboiled.common.ImmutableLinkedList<T>
- All Implemented Interfaces:
- java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>
public class ImmutableLinkedList<T>
- extends java.util.AbstractSequentialList<T>
| Fields inherited from class java.util.AbstractList |
modCount |
| Methods inherited from class java.util.AbstractSequentialList |
add, addAll, get, iterator, remove, set |
| Methods inherited from class java.util.AbstractList |
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList |
| Methods inherited from class java.util.AbstractCollection |
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray |
ImmutableLinkedList
public ImmutableLinkedList(T head,
ImmutableLinkedList<T> tail)
nil
public static <T> ImmutableLinkedList<T> nil()
head
public T head()
tail
public ImmutableLinkedList<T> tail()
last
public T last()
prepend
public ImmutableLinkedList<T> prepend(T object)
reverse
public ImmutableLinkedList<T> reverse()
equal
public static <T> boolean equal(ImmutableLinkedList<T> a,
ImmutableLinkedList<T> b)
hashCode
public static int hashCode(ImmutableLinkedList<?> list)
listIterator
public java.util.ListIterator<T> listIterator(int index)
- Specified by:
listIterator in interface java.util.List<T>- Specified by:
listIterator in class java.util.AbstractSequentialList<T>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface java.util.Collection<T>- Specified by:
isEmpty in interface java.util.List<T>- Overrides:
isEmpty in class java.util.AbstractCollection<T>
size
public int size()
- Specified by:
size in interface java.util.Collection<T>- Specified by:
size in interface java.util.List<T>- Specified by:
size in class java.util.AbstractCollection<T>