public class PrimitiveFloatArray extends AbstractPrimitiveArray
| Constructor and Description |
|---|
PrimitiveFloatArray()
Default constructor
|
PrimitiveFloatArray(PrimitiveFloatArray sourceArray)
Copying constructor
|
| Modifier and Type | Method and Description |
|---|---|
float[] |
asArray()
Get a reference to a float[] that represents the contents of this array.
|
static <A extends PrimitiveFloatArray> |
copyInstance(A source)
Create a new <A extends
PrimitiveFloatArray> instance, using a copy constructor to
replicate the contents of the given source array |
static <A extends PrimitiveFloatArray> |
copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
A source)
Create a new <A extends
PrimitiveFloatArray> instance, using a copy constructor to
replicate the contents of the given source array |
float |
get(int index)
Get the value of an element in the array.
|
float |
get(long index)
Get the value of an element in the array.
|
long |
getLength()
Get the length of the array
|
static <A extends PrimitiveFloatArray> |
newInstance(java.lang.Class<A> arrayClass,
long length)
Create a new instance of <A extends
PrimitiveFloatArray> with a given length. |
static <A extends PrimitiveFloatArray> |
newInstance(CtorAndArgs<A> arrayCtorAndArgs,
long length)
Create a new instance of <A extends
PrimitiveFloatArray> with a given length,
array constructor, and array constructor arguments. |
static PrimitiveFloatArray |
newInstance(long length)
Create a new instance of
PrimitiveFloatArray with a given length. |
static <A extends PrimitiveFloatArray> |
newInstance(long length,
java.lang.reflect.Constructor<A> arrayConstructor,
java.lang.Object... arrayConstructorArgs)
Create a new instance of <A extends
PrimitiveFloatArray> with a given length,
array constructor, and array constructor arguments. |
static <A extends PrimitiveFloatArray> |
newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
java.lang.Class<A> arrayClass,
long length)
Create a new instance of <A extends
PrimitiveFloatArray> with a given length. |
void |
set(int index,
float value)
set the value of an element in the array.
|
void |
set(long index,
float value)
set the value of an element in the array.
|
public PrimitiveFloatArray()
public PrimitiveFloatArray(PrimitiveFloatArray sourceArray)
sourceArray - the array to copypublic float[] asArray()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if array is too long to represent as a float[]public long getLength()
public float get(int index)
index - the index of the elementpublic float get(long index)
index - the index of the elementpublic void set(int index,
float value)
index - the index of the element to setvalue - the value to assign to the elementpublic void set(long index,
float value)
index - the index of the element to setvalue - the value to assign to the elementpublic static PrimitiveFloatArray newInstance(long length)
PrimitiveFloatArray with a given length.length - the length of the array.PrimitiveFloatArray with the given lengthpublic static <A extends PrimitiveFloatArray> A newInstance(java.lang.Class<A> arrayClass, long length)
PrimitiveFloatArray> with a given length.A - The class of the array to be created (extends PrimitiveFloatArray)arrayClass - The class of the array to be created (extends PrimitiveFloatArray)length - the length of the array.PrimitiveFloatArray> with a given lengthpublic static <A extends PrimitiveFloatArray> A newInstance(java.lang.invoke.MethodHandles.Lookup lookup, java.lang.Class<A> arrayClass, long length)
PrimitiveFloatArray> with a given length.A - The class of the array to be created (extends PrimitiveFloatArray)lookup - The lookup object to use for accessing the array's constructorarrayClass - The class of the array to be created (extends PrimitiveFloatArray)length - the length of the array.PrimitiveFloatArray> with a given lengthpublic static <A extends PrimitiveFloatArray> A newInstance(CtorAndArgs<A> arrayCtorAndArgs, long length)
PrimitiveFloatArray> with a given length,
array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveFloatArray)length - The length of the array.arrayCtorAndArgs - for creating the arrayPrimitiveFloatArray>public static <A extends PrimitiveFloatArray> A newInstance(long length, java.lang.reflect.Constructor<A> arrayConstructor, java.lang.Object... arrayConstructorArgs)
PrimitiveFloatArray> with a given length,
array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveFloatArray)length - The length of the array.arrayConstructor - The array constructor to usearrayConstructorArgs - The arguments to pass to the array constructorPrimitiveFloatArray>public static <A extends PrimitiveFloatArray> A copyInstance(A source) throws java.lang.NoSuchMethodException
PrimitiveFloatArray> instance, using a copy constructor to
replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveFloatArray)source - The array to replicatePrimitiveFloatArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic static <A extends PrimitiveFloatArray> A copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, A source) throws java.lang.NoSuchMethodException
PrimitiveFloatArray> instance, using a copy constructor to
replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveFloatArray)lookup - The lookup object to use for accessing the array's constructorsource - The array to replicatePrimitiveFloatArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructor