public class IntArrayBuffer extends AbstractArrayBuffer implements Iterable<Integer>
Usage Example:
IntArrayBuffer buf = new IntArrayBuffer(); Listresults = new ArrayList<>(); for (Object obj : listOfThingsToProcess) { for (Object x : obj.thingsThatShouldBecomeInts()) { buf.add(someCalculation(x)); } results.add(buf.toArray()); buf.clear(); }
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
buf |
| Constructor and Description |
|---|
IntArrayBuffer() |
IntArrayBuffer(int initialSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int c) |
void |
addAll(IntArrayBuffer o) |
IntArrayBuffer |
asFixedSizeArray(int size,
int initialValue) |
int |
get(int index) |
int[] |
getBuffer() |
void |
inc(int index) |
PrimitiveIterator.OfInt |
iterator() |
void |
set(int index,
int value) |
int[] |
toArray() |
clear, ensureCapacity, isEmpty, length, setLengthclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic IntArrayBuffer()
public IntArrayBuffer(int initialSize)
public int[] getBuffer()
public void add(int c)
public IntArrayBuffer asFixedSizeArray(int size, int initialValue)
public int get(int index)
public void inc(int index)
public void set(int index,
int value)
public void addAll(IntArrayBuffer o)
public int[] toArray()
public PrimitiveIterator.OfInt iterator()