public final class ArrayLong extends Object
| Constructor and Description |
|---|
ArrayLong()
Create a list of default size
|
ArrayLong(ArrayLong template)
Create a list based on an existing ArrayInt, of size of the template
|
ArrayLong(int initialCapacity)
Create an empty list of given capacity for more entries.
|
ArrayLong(long[] initialValues)
Create a list based on a supplied array
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(long element)
append one more entry
|
void |
addAll(ArrayLong template)
Append all of another ArrayLong to the end of this one.
|
void |
addAll(long[] elements)
Append a group of entries
|
void |
clear()
clear all the entries
|
long |
firstElement()
get the first entry to be written.
|
long |
get(int index)
Retrieve one entry
|
boolean |
isEmpty()
is the list empty
|
IteratorLong |
iterator()
get an iterator to go through the list
|
long |
lastElement()
get the last entry to be written.
|
long |
set(int index,
long element)
modify one particular entry
|
int |
size()
get the number of used entries
|
void |
sort()
arrange the entries in ascending order
|
long[] |
toArray()
convert to an array
|
public ArrayLong()
public ArrayLong(int initialCapacity)
initialCapacity - in number of entriespublic ArrayLong(long[] initialValues)
initialValues - a copy is taken of this arraypublic ArrayLong(ArrayLong template)
template - a copy is taken of these valuespublic void add(long element)
element - the int to add to the endpublic void addAll(long[] elements)
elements - an array of long, to be added to end of this ArrayLong.public void addAll(ArrayLong template)
template - the other ArrayLongpublic long set(int index,
long element)
index - into this ArrayLongelement - the new value to be put herepublic long get(int index)
index - into the ArrayLongpublic int size()
public long[] toArray()
public boolean isEmpty()
public IteratorLong iterator()
public void clear()
public long lastElement()
public long firstElement()
public void sort()