public abstract class SizedObjectFactory<T extends SizedObject> extends java.lang.Object
This class holds factories to produces objects of variable size/length.
It allows for object recycling, pre-allocation and stack allocations:
static SizedObjectFactory
Constructor and Description |
---|
SizedObjectFactory()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
T |
object(int capacity)
Returns an sized object possibly recycled or preallocated of specified
minimum size.
|
void |
recycle(SizedObject object)
Recycles the specified sized object.
|
public SizedObjectFactory()
public final T object(int capacity)
capacity
- the minimum size of the array to be returned.public void recycle(SizedObject object)
object
- the SizedObject to be recycled.