public final class FloatArrayAllocator extends TemporaryObjectAllocator<float>
FacetsAccumulatorand can be reused across searches instead of being allocated afresh on every search.
An FloatArrayAllocator is thread-safe.
|Constructor and Description|
Construct an allocator for float arrays of size
|Modifier and Type||Method and Description|
Subclasses must override this method to clear an existing object of the desired type, to prepare it for reuse.
Subclasses must override this method to actually create a new object of the desired type.
public FloatArrayAllocator(int size, int maxArrays)
size, keeping around a pool of up to
Note that the pool size only restricts the number of arrays that hang around when not needed, but not the maximum number of arrays that are allocated when actually is use: If a number of concurrent threads ask for an allocation, all of them will get a counter array, even if their number is greater than maxArrays. If an application wants to limit the number of concurrent threads making allocations, it needs to do so on its own - for example by blocking new threads until the existing ones have finished.
In particular, when maxArrays=0, this object behaves as a trivial allocator, always allocating a new array and never reusing an old one.
public float create()
public void clear(float array)
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.