Package pabeles.concurrency
Class GrowArray<D>
java.lang.Object
pabeles.concurrency.GrowArray<D>
public class GrowArray<D>
extends java.lang.Object
An array of objects which grows and recycles its elements automatically.
-
Constructor Summary
Constructors Constructor Description GrowArray(ConcurrencyOps.NewInstance<D> factory)GrowArray(ConcurrencyOps.NewInstance<D> factory, ConcurrencyOps.Reset<D> reset) -
Method Summary
-
Constructor Details
-
Method Details
-
reset
public void reset() -
resize
public void resize(int length)Increases the size of the array so that it contains the specified number of elements. If the new length is bigger than the old size then reset is called on the new elements -
grow
Add a new element to the array. Reset is called on it and it's then returned. -
get
-
size
public int size()
-