Class 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>
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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()  
      • 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.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Method Detail

      • head

        public T head()
      • last

        public T last()
      • 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>