Class BooleanBigArrayBigList

All Implemented Interfaces:
BigList<Boolean>, BooleanBigList, BooleanCollection, BooleanIterable, BooleanStack, Size64, Stack<Boolean>, Serializable, Cloneable, Comparable<BigList<? extends Boolean>>, Iterable<Boolean>, Collection<Boolean>, RandomAccess

public class BooleanBigArrayBigList
extends AbstractBooleanBigList
implements RandomAccess, Cloneable, Serializable
A type-specific big list based on a big array; provides some additional methods that use polymorphism to avoid (un)boxing.

This class implements a lightweight, fast, open, optimized, reuse-oriented version of big-array-based big lists. Instances of this class represent a big list with a big array that is enlarged as needed when new entries are created (by doubling the current length), but is never made smaller (even on a clear()). A family of trimming methods lets you control the size of the backing big array; this is particularly useful if you reuse instances of this class. Range checks are equivalent to those of java.util's classes, but they are delayed as much as possible. The backing big array is exposed by the elements() method.

This class implements the bulk methods removeElements(), addElements() and getElements() using high-performance system calls (e.g., System.arraycopy() instead of expensive loops.

See Also:
ArrayList, Serialized Form
  • Field Details

  • Constructor Details

    • BooleanBigArrayBigList

      public BooleanBigArrayBigList​(long capacity)
      Creates a new big-array big list with given capacity.
      Parameters:
      capacity - the initial capacity of the array list (may be 0).
    • BooleanBigArrayBigList

      public BooleanBigArrayBigList()
      Creates a new big-array big list with DEFAULT_INITIAL_CAPACITY capacity.
    • BooleanBigArrayBigList

      public BooleanBigArrayBigList​(BooleanCollection c)
      Creates a new big-array big list and fills it with a given type-specific collection.
      Parameters:
      c - a type-specific collection that will be used to fill the array list.
    • BooleanBigArrayBigList

      public BooleanBigArrayBigList​(BooleanBigList l)
      Creates a new big-array big list and fills it with a given type-specific list.
      Parameters:
      l - a type-specific list that will be used to fill the array list.
    • BooleanBigArrayBigList

      public BooleanBigArrayBigList​(boolean[][] a)
      Creates a new big-array big list and fills it with the elements of a given big array.

      Note that this constructor makes it easy to build big lists from literal arrays declared as type[][] {{ init_values }}. The only constraint is that the number of initialisation values is below BigArrays.SEGMENT_SIZE.

      Parameters:
      a - a big array whose elements will be used to fill the array list.
    • BooleanBigArrayBigList

      public BooleanBigArrayBigList​(boolean[][] a, long offset, long length)
      Creates a new big-array big list and fills it with the elements of a given big array.

      Note that this constructor makes it easy to build big lists from literal arrays declared as type[][] {{ init_values }}. The only constraint is that the number of initialisation values is below BigArrays.SEGMENT_SIZE.

      Parameters:
      a - a big array whose elements will be used to fill the array list.
      offset - the first element to use.
      length - the number of elements to use.
    • BooleanBigArrayBigList

      public BooleanBigArrayBigList​(Iterator<? extends Boolean> i)
      Creates a new big-array big list and fills it with the elements returned by an iterator..
      Parameters:
      i - an iterator whose returned elements will fill the array list.
    • BooleanBigArrayBigList

      public BooleanBigArrayBigList​(BooleanIterator i)
      Creates a new big-array big list and fills it with the elements returned by a type-specific iterator..
      Parameters:
      i - a type-specific iterator whose returned elements will fill the array list.
  • Method Details