Class AbstractLinkedList.LinkedSubList<E>

  • All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>
    Enclosing class:
    AbstractLinkedList<E>

    protected static class AbstractLinkedList.LinkedSubList<E>
    extends java.util.AbstractList<E>
    The sublist implementation for AbstractLinkedList.
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, E obj)  
      boolean addAll​(int index, java.util.Collection<? extends E> coll)  
      boolean addAll​(java.util.Collection<? extends E> coll)  
      protected void checkModCount()  
      void clear()  
      E get​(int index)  
      java.util.Iterator<E> iterator()  
      java.util.ListIterator<E> listIterator​(int index)  
      protected void rangeCheck​(int index, int beyond)  
      E remove​(int index)  
      E set​(int index, E obj)  
      int size()  
      java.util.List<E> subList​(int fromIndexInclusive, int toIndexExclusive)  
      • Methods inherited from class java.util.AbstractList

        add, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange
      • Methods inherited from class java.util.AbstractCollection

        contains, containsAll, isEmpty, 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

        contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Constructor Detail

      • LinkedSubList

        protected LinkedSubList​(AbstractLinkedList<E> parent,
                                int fromIndex,
                                int toIndex)
    • Method Detail

      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.List<E>
        Specified by:
        size in class java.util.AbstractCollection<E>
      • get

        public E get​(int index)
        Specified by:
        get in interface java.util.List<E>
        Specified by:
        get in class java.util.AbstractList<E>
      • add

        public void add​(int index,
                        E obj)
        Specified by:
        add in interface java.util.List<E>
        Overrides:
        add in class java.util.AbstractList<E>
      • remove

        public E remove​(int index)
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove in class java.util.AbstractList<E>
      • addAll

        public boolean addAll​(java.util.Collection<? extends E> coll)
        Specified by:
        addAll in interface java.util.Collection<E>
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class java.util.AbstractCollection<E>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends E> coll)
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class java.util.AbstractList<E>
      • set

        public E set​(int index,
                     E obj)
        Specified by:
        set in interface java.util.List<E>
        Overrides:
        set in class java.util.AbstractList<E>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<E>
        Specified by:
        clear in interface java.util.List<E>
        Overrides:
        clear in class java.util.AbstractList<E>
      • iterator

        public java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>
        Specified by:
        iterator in interface java.util.List<E>
        Overrides:
        iterator in class java.util.AbstractList<E>
      • listIterator

        public java.util.ListIterator<E> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<E>
        Overrides:
        listIterator in class java.util.AbstractList<E>
      • subList

        public java.util.List<E> subList​(int fromIndexInclusive,
                                         int toIndexExclusive)
        Specified by:
        subList in interface java.util.List<E>
        Overrides:
        subList in class java.util.AbstractList<E>
      • rangeCheck

        protected void rangeCheck​(int index,
                                  int beyond)
      • checkModCount

        protected void checkModCount()