cbox.util
Class ArrayRecycler
java.lang.Object
cbox.util.Recycler
cbox.util.ArrayRecycler
public final class ArrayRecycler
- extends Recycler
An array recycler for Object arrays. To use this utility, create
a global instance of this class, and then invoke
allocate(int) to create recyclable arrays.
As usual, invoke recycle(...) to release the array.
Note that the caller is expected to provide
thread safety for instances of this class.
- See Also:
RecyclableArray
ArrayRecycler
public ArrayRecycler()
- Constructs a recycler.
allocate
public final RecyclableArray allocate(int length)
- Attempts to obtain a free RecyclableArray.
- Returns:
- A RecyclableArray reference.
- Throws:
StackOverflowError - May be thrown due to the recursive implementation of the method.