public final class ObjectArrayBuffer<T> extends AbstractArrayBuffer implements Iterable<T>
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(T o) |
void |
addAll(Object[] arr) |
void |
addAll(Object[] arr,
int fromIndex,
int toIndex) |
void |
addAll(ObjectArrayBuffer<T> other) |
T |
get(int i) |
Iterator<T> |
iterator() |
Object |
peek() |
Object |
pop() |
void |
sort(Comparator<T> comparator) |
<ST> ST[] |
toArray(ST[] a) |
clear, ensureCapacity, isEmpty, length, setLengthclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic ObjectArrayBuffer()
public ObjectArrayBuffer(int initialSize)
public T get(int i)
public void add(T o)
public void addAll(ObjectArrayBuffer<T> other)
public void addAll(Object[] arr)
public void addAll(Object[] arr, int fromIndex, int toIndex)
public Object pop()
public Object peek()
public void sort(Comparator<T> comparator)
public <ST> ST[] toArray(ST[] a)