public final class ObjectArrayBuffer extends AbstractArrayBuffer implements Iterable<Object>
Usage Example:
SomeClass[] typedArray = new SomeClass[0]; ObjectArrayBuffer buf = new ObjectArrayBuffer(); Listresults = new ArrayList<>(); for (Object obj : listOfThingsToProcess) { for (Object x : obj.thingsThatShouldBecomeSomeClass()) { buf.add(someCalculation(x)); } results.add(buf.toArray(typedArray)); buf.clear(); }
| Constructor and Description |
|---|
ObjectArrayBuffer() |
ObjectArrayBuffer(int initialSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Object o) |
void |
addAll(Object[] arr,
int fromIndex,
int toIndex) |
void |
addAll(ObjectArrayBuffer other) |
Object |
get(int i) |
Object |
getLast() |
Iterator<Object> |
iterator() |
Object |
peek() |
Object |
pop() |
<T> T[] |
toArray(T[] a) |
clear, ensureCapacity, isEmpty, length, setLengthclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic ObjectArrayBuffer()
public ObjectArrayBuffer(int initialSize)
public Object get(int i)
public Object getLast()
public void add(Object o)
public void addAll(ObjectArrayBuffer other)
public void addAll(Object[] arr, int fromIndex, int toIndex)
public Object pop()
public Object peek()
public <T> T[] toArray(T[] a)