Class MutableVectorList<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
org.jhotdraw8.icollection.MutableVectorList<E>
Type Parameters:
E - the element type
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, SequencedCollection<E>, ReadOnlyCollection<E>, ReadOnlyList<E>, ReadOnlySequencedCollection<E>

public class MutableVectorList<E> extends AbstractList<E> implements Serializable, ReadOnlyList<E>, List<E>, Cloneable
Implements the List interface using a bit-mapped trie (Vector).

Features:

  • supports up to 231 - 1 elements
  • allows null elements
  • is immutable
  • is thread-safe
  • iterates in the order of the list

Performance characteristics:

  • addLast: O(log N)
  • set: O(log N)
  • removeAt: O(N)
  • removeFirst,removeLast: O(log N)
  • contains: O(N)
  • toImmutable: O(1)
  • clone: O(1)
  • iterator.next(): O(1)

References:

This class has been derived from Vavr Vector.java.

Vector.java. Copyright 2023 (c) vavr. MIT License.
github.com
See Also: