Package net.dermetfan.gdx.utils
Class FloatArrayPool
java.lang.Object
net.dermetfan.gdx.utils.FloatArrayPool
public class FloatArrayPool
extends java.lang.Object
pools arrays by their size
- Since:
- 0.11.1
-
Field Summary
-
Constructor Summary
Constructors Constructor Description FloatArrayPool(int max, int maxEach)
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
max
public final int maxthe maximum amount of arrays of different lengths that will be pooled -
maxEach
public final int maxEachthe maximum amount of arrays of the same length that will be pooled
-
-
Constructor Details
-
FloatArrayPool
public FloatArrayPool(int max, int maxEach)
-
-
Method Details
-
obtain
public float[] obtain(int length)- Parameters:
length
- the desired length of the array
-
free
public void free(float[] array)- Parameters:
array
- the array to put back into the pool
-
clear
public void clear() -
getFree
public int getFree(int length)- Returns:
- the number of arrays of the given length in the pool
-