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