public class LongArrayBuffer extends AbstractArrayBuffer
Usage Example:
LongArrayBuffer buf = new LongArrayBuffer(); Listresults = new ArrayList<>(); for (Object obj : listOfThingsToProcess) { for (Object x : obj.thingsThatShouldBecomeLongs()) { buf.add(someCalculation(x)); } results.add(buf.toArray()); buf.clear(); }
| Modifier and Type | Field and Description |
|---|---|
protected long[] |
buf |
| Constructor and Description |
|---|
LongArrayBuffer(int initialSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(long v) |
LongArrayBuffer |
asFixedSizeArray(int size) |
LongArrayBuffer |
asFixedSizeArray(int size,
int initialValue) |
long |
get(int i) |
long |
peek() |
long |
pop() |
long[] |
toArray() |
clear, ensureCapacity, isEmpty, length, setLengthpublic long get(int i)
public void add(long v)
public long pop()
public long peek()
public LongArrayBuffer asFixedSizeArray(int size)
public LongArrayBuffer asFixedSizeArray(int size, int initialValue)
public long[] toArray()