public class FloatArrayFunctions extends java.lang.Object implements ArrayFunctions<float[]>
| Modifier and Type | Field and Description |
|---|---|
static FloatArrayFunctions |
INSTANCE |
| Modifier | Constructor and Description |
|---|---|
protected |
FloatArrayFunctions() |
| Modifier and Type | Method and Description |
|---|---|
float[] |
concat(float[] array1,
float[] array2)
Concatenates two arrays into one and returns it.
|
void |
copyArray(float[] from,
int fromOffset,
float[] to,
int toOffset,
int length)
Copies part of the first array to the second array.
|
float[] |
copyOfRange(float[] original,
int from,
int to)
Copies the specified range.
|
boolean |
endsWith(float[] array,
float[] subarray)
Checks if
array[length - subarray.length:] == subarray. |
boolean |
equals(float[] array1,
float[] array2)
Checks if the two arrays have the same content.
|
boolean |
equals(float[] array1,
int array1Index,
float[] array2,
int array2Index)
Checks if
array1[array1Index] == array2[array2Index]. |
int |
getCommonPrefixLength(float[] array1,
float[] array2)
Determines the longest common prefix, that is, the number of items at
the start of the arrays that are equal.
|
int |
getCommonSuffixLength(float[] array1,
float[] array2)
Determines the longest common suffix, that is, the number of items at
the end of the arrays that are equal.
|
int |
getLength(float[] value)
Gets the length of the given array.
|
float[] |
newArray(int length)
Constructs a new array of the given length.
|
float[] |
read(BytesDataInput input)
Reads an array from the given input stream.
|
float[] |
read(DataInput input)
Reads an array from the given input stream.
|
float[] |
readRaw(BytesDataInput input,
int length)
Reads an array from the given input stream.
|
float[] |
readRaw(DataInput input,
int length)
Reads an array from the given input stream.
|
boolean |
startsWith(float[] array,
float[] subarray)
Checks if
array[:subarray.length] == subarray. |
void |
write(BytesDataOutput output,
float[] value)
Writes the contents of the given array to the output stream.
|
void |
write(DataOutput output,
float[] value)
Writes the contents of the given array to the output stream.
|
void |
writeRaw(BytesDataOutput output,
float[] value)
Writes the contents of the given array to the output stream.
|
void |
writeRaw(DataOutput output,
float[] value)
Writes the contents of the given array to the output stream.
|
public static final FloatArrayFunctions INSTANCE
public float[] newArray(int length)
ArrayFunctionsnewArray in interface ArrayFunctions<float[]>length - array lengthpublic int getLength(float[] value)
ArrayFunctionsgetLength in interface ArrayFunctions<float[]>value - array valuepublic boolean equals(float[] array1,
float[] array2)
ArrayFunctionsequals in interface ArrayFunctions<float[]>array1 - first arrayarray2 - second arraypublic float[] concat(float[] array1,
float[] array2)
ArrayFunctionsconcat in interface ArrayFunctions<float[]>array1 - first arrayarray2 - second arraypublic boolean startsWith(float[] array,
float[] subarray)
ArrayFunctionsarray[:subarray.length] == subarray.startsWith in interface ArrayFunctions<float[]>array - array to checksubarray - array prefix to check forpublic boolean endsWith(float[] array,
float[] subarray)
ArrayFunctionsarray[length - subarray.length:] == subarray.endsWith in interface ArrayFunctions<float[]>array - array to checksubarray - array suffix to check forpublic int getCommonSuffixLength(float[] array1,
float[] array2)
ArrayFunctionsgetCommonSuffixLength in interface ArrayFunctions<float[]>array1 - first arrayarray2 - second arraypublic int getCommonPrefixLength(float[] array1,
float[] array2)
ArrayFunctionsgetCommonPrefixLength in interface ArrayFunctions<float[]>array1 - first arrayarray2 - second arraypublic float[] copyOfRange(float[] original,
int from,
int to)
ArrayFunctionscopyOfRange in interface ArrayFunctions<float[]>original - array to copy fromfrom - range start indexto - range end indexpublic void copyArray(float[] from,
int fromOffset,
float[] to,
int toOffset,
int length)
ArrayFunctionscopyArray in interface ArrayFunctions<float[]>from - array to copy fromfromOffset - offset to copy fromto - array to copy tcotoOffset - offset to copy tolength - number of items to copypublic boolean equals(float[] array1,
int array1Index,
float[] array2,
int array2Index)
ArrayFunctionsarray1[array1Index] == array2[array2Index].equals in interface ArrayFunctions<float[]>array1 - first arrayarray1Index - first array indexarray2 - second arrayarray2Index - second array indexpublic void write(DataOutput output, float[] value) throws java.io.IOException
ArrayFunctionswrite in interface ArrayFunctions<float[]>output - stream to write tovalue - array to be writtenjava.io.IOException - if an I/O error occurspublic void writeRaw(DataOutput output, float[] value) throws java.io.IOException
ArrayFunctionswriteRaw in interface ArrayFunctions<float[]>output - stream to write tovalue - array to be writtenjava.io.IOException - if an I/O error occurspublic void write(BytesDataOutput output, float[] value)
ArrayFunctionswrite in interface ArrayFunctions<float[]>output - stream to write tovalue - array to be writtenpublic void writeRaw(BytesDataOutput output, float[] value)
ArrayFunctionswriteRaw in interface ArrayFunctions<float[]>output - stream to write tovalue - array to be writtenpublic float[] read(DataInput input) throws java.io.IOException
ArrayFunctionsread in interface ArrayFunctions<float[]>input - stream to read fromjava.io.IOException - if an I/O error occurspublic float[] readRaw(DataInput input, int length) throws java.io.IOException
ArrayFunctionsreadRaw in interface ArrayFunctions<float[]>input - stream to read fromlength - array lengthjava.io.IOException - if an I/O error occurspublic float[] read(BytesDataInput input)
ArrayFunctionsread in interface ArrayFunctions<float[]>input - stream to read frompublic float[] readRaw(BytesDataInput input, int length)
ArrayFunctionsreadRaw in interface ArrayFunctions<float[]>input - stream to read fromlength - array length