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