public class LongList
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
_count
the count of longs in the list *
|
private long[] |
_list
the list *
|
private static int |
GROW
the growth rate *
|
private static int |
INITIAL_CAPACITY
the initial capacity *
|
Modifier and Type | Method and Description |
---|---|
void |
add(long l)
Add a long to the list
|
void |
add(long l,
int i)
Add a long at index i
|
private void |
ensureCapacity(int size)
ensure the capacity of the long
|
long |
first()
Return the first long in the list
|
long |
get(int i)
Get the long on index i in the list
|
long |
last()
Return the last long in the list
|
long |
remove(int i)
Remove the long at index i
|
private static final int INITIAL_CAPACITY
private static final int GROW
private int _count
private long[] _list
public LongList()
public LongList(int capacity)
capacity
- initial capacitypublic void add(long l)
l
- the longpublic long get(int i)
i
- the indexpublic void add(long l, int i)
l
- the longi
- the indexprivate void ensureCapacity(int size)
size
- the sizepublic long remove(int i)
i
- the indexpublic long first()
public long last()