Package org.apache.commons.collections4.list

# Class AbstractLinkedList.LinkedSubList<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
org.apache.commons.collections4.list.AbstractLinkedList.LinkedSubList<E>

Type Parameters:
  `E` - the type of elements in this list.

All Implemented Interfaces:
  `Iterable<E>`, `Collection<E>`, `List<E>`

Enclosing class:
  `AbstractLinkedList<E>`

protected static class AbstractLinkedList.LinkedSubList<E> extends AbstractList<E>
The sublist implementation for AbstractLinkedList.

- ## Field Summary

  ### Fields inherited from class java.util.AbstractList

  `modCount`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `LinkedSubList(AbstractLinkedList<E> parent, int fromIndex, int toIndex)`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(int index, E obj)`
  `boolean`
  `addAll(int index, Collection<? extends E> coll)`
  `boolean`
  `addAll(Collection<? extends E> coll)`
  `protected void`
  `checkModCount()`
  Throws a `ConcurrentModificationException` if this instance fails its concurrency check.
  `void`
  `clear()`
  `E`
  `get(int index)`
  `Iterator<E>`
  `iterator()`
  `ListIterator<E>`
  `listIterator(int index)`
  `protected void`
  `rangeCheck(int index, int beyond)`
  Throws an `IndexOutOfBoundsException` if the given indices are out of bounds.
  `E`
  `remove(int index)`
  `E`
  `set(int index, E obj)`
  `int`
  `size()`
  `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`

  ### 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 Details

  - ### LinkedSubList

    protected LinkedSubList(AbstractLinkedList<E> parent, int fromIndex, int toIndex)
    Constructs a new instance.
    Parameters:
      `parent` - The parent AbstractLinkedList.
      `fromIndex` - An index greater or equal to 0 and less than `toIndex`.
      `toIndex` - An index greater than `fromIndex`.

- ## Method Details

  - ### add

    public void add(int index, E obj)
    Specified by:
      `add` in interface `List<E>`
    Overrides:
      `add` in class `AbstractList<E>`

  - ### addAll

    public boolean addAll(Collection<? extends E> coll)
    Specified by:
      `addAll` in interface `Collection<E>`
    Specified by:
      `addAll` in interface `List<E>`
    Overrides:
      `addAll` in class `AbstractCollection<E>`

  - ### addAll

    public boolean addAll(int index, Collection<? extends E> coll)
    Specified by:
      `addAll` in interface `List<E>`
    Overrides:
      `addAll` in class `AbstractList<E>`

  - ### checkModCount

    protected void checkModCount()
    Throws a `ConcurrentModificationException` if this instance fails its concurrency check.

  - ### clear

    public void clear()
    Specified by:
      `clear` in interface `Collection<E>`
    Specified by:
      `clear` in interface `List<E>`
    Overrides:
      `clear` in class `AbstractList<E>`

  - ### get

    public E get(int index)
    Specified by:
      `get` in interface `List<E>`
    Specified by:
      `get` in class `AbstractList<E>`

  - ### iterator

    public Iterator<E> iterator()
    Specified by:
      `iterator` in interface `Collection<E>`
    Specified by:
      `iterator` in interface `Iterable<E>`
    Specified by:
      `iterator` in interface `List<E>`
    Overrides:
      `iterator` in class `AbstractList<E>`

  - ### listIterator

    public ListIterator<E> listIterator(int index)
    Specified by:
      `listIterator` in interface `List<E>`
    Overrides:
      `listIterator` in class `AbstractList<E>`

  - ### rangeCheck

    protected void rangeCheck(int index, int beyond)
    Throws an `IndexOutOfBoundsException` if the given indices are out of bounds.
    Parameters:
      `index` - lower index.
      `beyond` - upper index.

  - ### remove

    public E remove(int index)
    Specified by:
      `remove` in interface `List<E>`
    Overrides:
      `remove` in class `AbstractList<E>`

  - ### set

    public E set(int index, E obj)
    Specified by:
      `set` in interface `List<E>`
    Overrides:
      `set` in class `AbstractList<E>`

  - ### size

    public int size()
    Specified by:
      `size` in interface `Collection<E>`
    Specified by:
      `size` in interface `List<E>`
    Specified by:
      `size` in class `AbstractCollection<E>`

  - ### subList

    public List<E> subList(int fromIndexInclusive, int toIndexExclusive)
    Specified by:
      `subList` in interface `List<E>`
    Overrides:
      `subList` in class `AbstractList<E>`