public class LongList extends Object implements Serializable, Cloneable
Constructor and Description |
---|
LongList(int capacity)
Creates a new IntList with the given initial capacity.
|
LongList(long[] data,
int increment) |
Modifier and Type | Method and Description |
---|---|
void |
add(long value)
Adds the given int value to the list.
|
void |
clear()
Clears the list.
|
Object |
clone()
Creates a copy of this list.
|
void |
fill(long value) |
long |
get(int index)
Returns the value at the given index.
|
void |
remove(int index) |
void |
set(int index,
long value)
Adds the given int value to the list.
|
int |
size()
Returns the number of elements in this list.
|
long[] |
toArray()
Copys the list contents into a new array.
|
long[] |
toArray(long[] retval)
Copys the list contents into a new array.
|
String |
toString() |
public LongList(int capacity)
capacity
- the initial capacity.public LongList(long[] data, int increment)
public void add(long value)
value
- the new value to be added.public void remove(int index)
public void set(int index, long value)
value
- the new value to be defined.index
- the position of the valur that should be redefined.public long get(int index)
index
- the indexIndexOutOfBoundsException
- if the index is greater or equal to the list size or if the index is negative.public void clear()
public int size()
public long[] toArray()
public long[] toArray(long[] retval)
retval
- the array that should receive the contents.public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- if something went wrong during the cloning.public void fill(long value)