public final class PrimitiveArrayUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
arrayEquals(double[] a,
double[] a2,
int size)
Array equals that takes into account the size
|
static boolean |
arrayEquals(float[] a,
float[] a2,
int size)
Array equals that takes into account the size
|
static int |
arrayHashCode(double[] a,
int size)
Array hash code that takes into account the peak list size
|
static int |
arrayHashCode(float[] a,
int size)
Array hash code that takes into account the peak list size
|
static double[] |
copyArray(double[] src,
int srcPos,
double[] dest,
int destPos,
int length)
Wraps System.arrayCopy and creates a new array if required
|
static double[] |
copyArray(float[] src,
int srcPos,
double[] dest,
int destPos,
int length)
Copies an array from the specified source array, beginning at the
specified position, to the specified position of the destination array.
|
static double[] |
grow(double[] arr,
int loadFactor)
Grow the array arr by loadFactor
|
static float[] |
grow(float[] arr,
int loadFactor)
Grow the array arr by loadFactor
|
static int |
indexMax(double[] values)
Get the index of the maximum value
|
static void |
insert(double value,
int index,
double[] arr,
int size)
Insert the value into the array at index.
|
static void |
insert(float value,
int index,
float[] arr,
int size)
Insert the value into the array at index.
|
static double[] |
loadDoubles(double[] src,
double[] dest)
Load doubles from src to dest arrays.
|
static double[] |
loadDoubles(double[] src,
double[] dest,
int destPos)
Load doubles from src to dest arrays.
|
static Double[] |
toDoubles(double[] src,
Double[] dest)
Convert double array to Double array.
|
static Double[] |
toDoubles(double[] src,
Double[] dest,
int destPos)
Convert double array to Double array.
|
static double[] |
trim(double[] arr,
int size)
Trim the arr to the size of this DoublePeakList
|
static float[] |
trim(float[] arr,
int size)
Trim the arr to the size of this DoublePeakList
|
public static double[] grow(double[] arr,
int loadFactor)
arr - the array to growloadFactor - the amount to grow the arraypublic static float[] grow(float[] arr,
int loadFactor)
arr - the array to growloadFactor - the amount to grow the arraypublic static void insert(double value,
int index,
double[] arr,
int size)
value - the value to insertindex - the index in which the value is to be insertedarr - the array to insert the valuesize - the size of the peak listpublic static void insert(float value,
int index,
float[] arr,
int size)
value - the value to insertindex - the index in which the value is to be insertedarr - the array to insert the valuesize - the size of the peak listpublic static double[] copyArray(double[] src,
int srcPos,
double[] dest,
int destPos,
int length)
src - the src arraysrcPos - the src positiondest - the dest arraydestPos - the dest positionlength - the number of elements to copypublic static double[] copyArray(float[] src,
int srcPos,
double[] dest,
int destPos,
int length)
src - the src arraysrcPos - the src positiondest - the dest arraydestPos - the dest positionlength - the number of elements to copypublic static double[] trim(double[] arr,
int size)
arr - the array to trimpublic static float[] trim(float[] arr,
int size)
arr - the array to trimpublic static int arrayHashCode(double[] a,
int size)
a - the arraypublic static int arrayHashCode(float[] a,
int size)
a - the arraypublic static boolean arrayEquals(double[] a,
double[] a2,
int size)
a - the first arraya2 - the second arraypublic static boolean arrayEquals(float[] a,
float[] a2,
int size)
a - the first arraya2 - the second arraypublic static double[] loadDoubles(double[] src,
double[] dest)
src - the source array to load from.dest - the destination array to load to.public static double[] loadDoubles(double[] src,
double[] dest,
int destPos)
src - the source array to load from.dest - the destination array to load to.destPos - starting position in the destination data.public static Double[] toDoubles(double[] src, Double[] dest)
src - the source array to load from.dest - the destination array to load to.public static Double[] toDoubles(double[] src, Double[] dest, int destPos)
src - the source array to load from.dest - the destination array to load to.destPos - starting position in the destination data.public static int indexMax(double[] values)
values - the array to search for the maxCopyright © 2016. All Rights Reserved.