# Package org.apache.commons.collections4.list

package org.apache.commons.collections4.list
Implements the `List` interface.

The following implementations are provided in the package:

- TreeList - a list that is optimized for insertions and removals at any index in the list
- CursorableLinkedList - a list that can be modified while the listIterator (cursor) is being used
- NodeCachingLinkedList - a linked list that caches the storage nodes for a performance gain

The following decorators are provided in the package:

- Unmodifiable - ensures the collection cannot be altered
- Predicated - ensures that only elements that are valid according to a predicate can be added
- Transformed - transforms each element added
- FixedSize - ensures that the size of the list cannot change
- Lazy - creates objects in the list on demand
- Growth - grows the list instead of erring when set/add used with index beyond the list size
- SetUnique - a list that avoids duplicate entries like a Set

- Related Packages
  Package
  Description
  org.apache.commons.collections4
  Interfaces and utilities shared across all packages.
- Classes
  Class
  Description
  AbstractLinkedList<E>
  Deprecated.
  use `AbstractLinkedListJava21` instead
  AbstractLinkedList.LinkedListIterator<E>
  A list iterator over the linked list.
  AbstractLinkedList.LinkedSubList<E>
  The sublist implementation for AbstractLinkedList.
  AbstractLinkedList.LinkedSubListIterator<E>
  A list iterator over the linked sub list.
  AbstractLinkedList.Node<E>
  A node within the linked list.
  AbstractLinkedListJava21<E>
  An abstract implementation of a linked list which provides numerous points for subclasses to override.
  AbstractLinkedListJava21.LinkedListIterator<E>
  A list iterator over the linked list.
  AbstractLinkedListJava21.LinkedSubList<E>
  The sublist implementation for AbstractLinkedListJava21.
  AbstractLinkedListJava21.LinkedSubListIterator<E>
  A list iterator over the linked sub list.
  AbstractLinkedListJava21.Node<E>
  A node within the linked list.
  AbstractListDecorator<E>
  Decorates another `List` to provide additional behavior.
  AbstractSerializableListDecorator<E>
  Serializable subclass of AbstractListDecorator.
  CursorableLinkedList<E>
  Deprecated.
  parent `AbstractLinkedList` is source incompatible with List methods added in Java 21
  CursorableLinkedList.Cursor<E>
  An extended `ListIterator` that allows concurrent changes to the underlying list.
  CursorableLinkedList.SubCursor<E>
  A cursor for the sublist based on LinkedSubListIterator.
  FixedSizeList<E>
  Decorates another `List` to fix the size preventing add/remove.
  GrowthList<E>
  Decorates another `List` to make it seamlessly grow when indices larger than the list size are used on add and set, avoiding most IndexOutOfBoundsExceptions.
  LazyList<E>
  Decorates another `List` to create objects in the list on demand.
  NodeCachingLinkedList<E>
  Deprecated.
  parent `AbstractLinkedList` is source incompatible with List methods added in Java 21
  PredicatedList<E>
  Decorates another `List` to validate that all additions match a specified predicate.
  SetUniqueList<E>
  Decorates a `List` to ensure that no duplicates are present much like a `Set`.
  TransformedList<E>
  Decorates another `List` to transform objects that are added.
  TreeList<E>
  A `List` implementation that is optimized for fast insertions and removals at any index in the list.
  UnmodifiableList<E>
  Decorates another `List` to ensure it can't be altered.