public final class FloatJArrayHolder
extends java.lang.Object
quickNew(int)
method,
that probably will work very quickly.
The previously allocated array is stored inside the object in a SoftReference.
This class is thread-safe: you may use the same instance of this class in several threads.
Constructor and Description |
---|
FloatJArrayHolder() |
Modifier and Type | Method and Description |
---|---|
float[] |
quickClone(float[] array)
Quick analog of array.clone().
|
float[] |
quickNew(int newArrayLength)
Quick analog of new float[newArrayLength]}.
|
float[] |
quickNew(long newArrayLength)
Equivalent of
quickNew(int) method, but in addition it checks that
newArrayLength is actually 32-bit value (newArrayLength==(int)newArrayLength)
and, if not, throws TooLargeArrayException . |
public float[] quickNew(long newArrayLength)
quickNew(int)
method, but in addition it checks that
newArrayLength is actually 32-bit value (newArrayLength==(int)newArrayLength)
and, if not, throws TooLargeArrayException
.newArrayLength
- required array length.java.lang.IllegalArgumentException
- if newArrayLength < 0.TooLargeArrayException
- if newArrayLength > Integer.MAX_VALUE.public float[] quickNew(int newArrayLength)
Please remember: unlike standard new operator, the returned array is usually not filled by zeros.
newArrayLength
- required array length.java.lang.IllegalArgumentException
- if newArrayLength < 0public float[] quickClone(float[] array)
float[] result = quickNew(int)
quickNew}(array.length);
System.arraycopy(array, 0, result, 0, array.length);
(return result)
array
- some array to clone.java.lang.NullPointerException
- if the passed array is null.