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