|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.onemind.commons.java.datastructure.LongList
public class LongList
Represents a list of long
Field Summary | |
---|---|
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 * |
Constructor Summary | |
---|---|
LongList()
|
|
LongList(int capacity)
|
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int INITIAL_CAPACITY
private static final int GROW
private int _count
private long[] _list
Constructor Detail |
---|
public LongList()
public LongList(int capacity)
capacity
- initial capacityMethod Detail |
---|
public void add(long l)
l
- the longpublic long get(int i)
i
- the index
public void add(long l, int i)
l
- the longi
- the indexprivate void ensureCapacity(int size)
size
- the sizepublic long remove(int i)
i
- the index
public long first()
public long last()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |