Class ArrayBlockList<V>

All Implemented Interfaces:
Serializable, Cloneable, Iterable<V>, Collection<V>, List<V>, RandomAccess

public class ArrayBlockList<V> extends ArrayList<V>
This is an extension to the JRE's java.util.ArrayList with the ability to do block removes exposed for public use.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • ArrayBlockList

      public ArrayBlockList(int initialCapacity)
      Constructs an empty list with the specified initial capacity.
      Parameters:
      initialCapacity - the initial capacity of the list
      Throws:
      IllegalArgumentException - if the specified initial capacity is negative
    • ArrayBlockList

      public ArrayBlockList()
      Constructs an empty list with an initial capacity of ten.
    • ArrayBlockList

      public ArrayBlockList(Collection<? extends V> c)
      Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
      Parameters:
      c - the collection whose elements are to be placed into this list
      Throws:
      NullPointerException - if the specified collection is null
  • Method Details

    • removeRange

      public void removeRange(int fromIndex, int toIndex)
      Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the list by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)
      Overrides:
      removeRange in class ArrayList<V>
      Parameters:
      fromIndex - index of first element to be removed
      toIndex - index after last element to be removed
      Throws:
      IndexOutOfBoundsException - if fromIndex or toIndex out of range (fromIndex < 0 || fromIndex >= size() || toIndex > size() || toIndex < fromIndex)