Package com.complexible.common.collect

# Class BigArrayList<T>

java.lang.Object
com.complexible.common.collect.BigArrayList<T>

Type Parameters:
  `T` -

All Implemented Interfaces:
  `Iterable<T>`

public final class BigArrayList<T> extends Object implements Iterable<T>

Simple implementation of a list that can have more than Integer.MAX_VALUE values. Works as a normal `ArrayList` until the size gets bigger than Integer.MAX_VALUE. After that, it works as a `List` of `ArrayList`s, so `get(long)` will be a little bit more expensive.

For now, only `add(Object)`, `get(long)`, and `size()` are supported.

Since:
  2.0
Version:
  2.0
Author:
  Pedro Oliveira

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `DEFAULT_MAX_SIZE`
  The default max size a `List` can have

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BigArrayList()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `add(T element)`
  Appends the specified element to the end of this list.
  `void`
  `clear()`
  `static <T> BigArrayList<T>`
  `create()`
  `static <T> BigArrayList<T>`
  `create(int maxSize)`
  `T`
  `get(long index)`
  Returns the element at the specified position in this list.
  `Iterator<T>`
  `iterator()`
  `T`
  `set(long theIndex, T theElem)`
  Set the value of the index
  `long`
  `size()`
  Returns the number of elements in this list.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

- ## Field Details

  - ### DEFAULT_MAX_SIZE

    public static final int DEFAULT_MAX_SIZE
    The default max size a `List` can have
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### BigArrayList

    public BigArrayList()

- ## Method Details

  - ### create

    public static <T> BigArrayList<T> create()

  - ### create

    public static <T> BigArrayList<T> create(int maxSize)

  - ### get

    public T get(long index)
    Returns the element at the specified position in this list.
    Parameters:
      `index` -
    Returns:

  - ### set

    public T set(long theIndex, T theElem)
    Set the value of the index
    Parameters:
      `theIndex` - the index
      `theElem` - the element to set at the index
    Returns:
      the value

  - ### add

    public boolean add(T element)
    Appends the specified element to the end of this list.
    Parameters:
      `element` -
    Returns:

  - ### size

    public long size()
    Returns the number of elements in this list.
    Returns:

  - ### clear

    public void clear()

  - ### iterator

    public Iterator<T> iterator()
    Specified by:
      `iterator` in interface `Iterable<T>`