public class LongList extends PrimitiveList
Constructor and Description |
---|
LongList()
Constructs a new list.
|
LongList(int size)
Constructs a new list with a given initial capacity.
|
LongList(long[] array)
Constructs a new list initialised to the contents of a given array.
|
Modifier and Type | Method and Description |
---|---|
void |
add(long value)
Appends a value to the end of this list.
|
boolean |
addAll(long[] array)
Appends all the elements of a primitive array to this list.
|
boolean |
addAll(LongList other)
Appends all the elements of a second list to this list.
|
long |
get(int i)
Returns the element at a given position.
|
long[] |
getLongBuffer()
Returns the array currently used to store the contents of this list.
|
void |
set(int i,
long value)
Sets the element at a given position.
|
long[] |
toLongArray()
Returns the contents of this list as an array.
|
clear, nextCapacity, size, toArray
public LongList()
public LongList(int size)
size
- initial capacitypublic LongList(long[] array)
array
- array whose contents form initial contents of listpublic long get(int i)
i
- indexi
public void set(int i, long value)
i
- indexvalue
- new value for element i
public void add(long value)
value
- value to appendpublic boolean addAll(LongList other)
other
- other listpublic boolean addAll(long[] array)
array
- array to appendpublic long[] toLongArray()
public long[] getLongBuffer()