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>
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 ArrayLists, 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAppends the specified element to the end of this list.voidclear()static <T> BigArrayList<T> create()static <T> BigArrayList<T> create(int maxSize) get(long index) Returns the element at the specified position in this list.iterator()Set the value of the indexlongsize()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, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
DEFAULT_MAX_SIZE
public static final int DEFAULT_MAX_SIZEThe default max size aListcan have- See Also:
-
-
Constructor Details
-
BigArrayList
public BigArrayList()
-
-
Method Details
-
create
-
create
-
get
Returns the element at the specified position in this list.- Parameters:
index-- Returns:
-
set
Set the value of the index- Parameters:
theIndex- the indextheElem- the element to set at the index- Returns:
- the value
-
add
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
-