|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.util.FloatArray
Class FloatArray encapsulates utilities for arrays of
float.
Class FloatArray cannot be instantiated.
| Constructor Summary | |
private |
FloatArray()
Private constructor to prevent instantiation. |
| Method Summary | |
static boolean |
checkArray(float[][] array,
int S)
Returns true if and only if the data array is non- null
and has S float numbers in each row. |
static boolean |
checkArrayPair(float[][] array1,
float[][] array2,
int S)
Returns true if and only if both data arrays are non- null,
have the same length N, and have S float numbers in each row. |
static float[] |
deepclone(float[] data)
Returns a deep clone of an array float[]. |
static float[][] |
deepclone(float[][] data)
Returns a deep clone of an array float[][]. |
static float[][] |
deepmerge(float[][] array1,
float[][] array2)
Returns a deep merge of the given arrays of float[][]. |
static float[] |
deepmerge(float[] array1,
float[] array2)
Returns a deep merge of the given arrays of float[]. |
static boolean |
equals(float[][] array1,
float[][] array2)
Returns true if the two arrays are both null or are
both non-null and have the same structure and data. |
static boolean |
equals(float[] array1,
float[] array2)
Returns true if the two arrays are both null or are
both non-null and have the same size and data. |
static float[] |
fromPoint2D(Point2D point)
Returns a new size 2 float[] corresponding to the given
Point2D. |
static float[][] |
fromPoint2D(Point2D[] points)
Returns a new float[][] of size N-by-2 corresponding to
the given Point2D[] of size N. |
static Point2D |
toPoint2D(float[] array)
Returns a new Point2D corresponding to the given
float[] provided the parameter is non-null
and of size 2. |
static Point2D[] |
toPoint2D(float[][] array)
Returns a new Point2D[] of size N corresponding to
the given float[][] of size N-by-2. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
private FloatArray()
| Method Detail |
public static float[] deepclone(float[] data)
Returns a deep clone of an array float[].
Returns null if the given data
is null.
data - the array to deep clone
public static float[][] deepclone(float[][] data)
Returns a deep clone of an array float[][].
Returns null if the given data
is null.
data - the array to deep clone
public static float[] deepmerge(float[] array1,
float[] array2)
Returns a deep merge of the given arrays of float[]. This means:
null,
return null;null,
return a deep clone of the other array;null,
return an array whose length is the sum of the lengths
of the given arrays and whose data is the data of the
first array followed by the data of the second array.
array1 - the first array to deep mergearray2 - the second array to deep merge
public static float[][] deepmerge(float[][] array1,
float[][] array2)
Returns a deep merge of the given arrays of float[][]. This means:
null,
return null;null,
return a deep clone of the other array;null,
return an array whose length is the maximum of the lengths
of the given arrays and whose rows are created
by performing a deep merge of the rows of the given arrays.
array1 - the first array to deep mergearray2 - the second array to deep merge
public static boolean checkArray(float[][] array,
int S)
null
and has S float numbers in each row.
array - the array to checkS - the desired size of each row
public static boolean checkArrayPair(float[][] array1,
float[][] array2,
int S)
null,
have the same length N, and have S float numbers in each row.
array1 - the first array to checkarray2 - the second array to checkS - the desired size of each row
public static boolean equals(float[] array1,
float[] array2)
null or are
both non-null and have the same size and data.
array1 - the first arrayarray2 - the second array
public static boolean equals(float[][] array1,
float[][] array2)
null or are
both non-null and have the same structure and data.
array1 - the first arrayarray2 - the second arraypublic static float[] fromPoint2D(Point2D point)
Returns a new size 2 float[] corresponding to the given
Point2D.
Returns null if the parameter is null.
point - the point to convertpublic static float[][] fromPoint2D(Point2D[] points)
Returns a new float[][] of size N-by-2 corresponding to
the given Point2D[] of size N.
Returns null if the parameter is null.
points - the points to convertpublic static Point2D toPoint2D(float[] array)
Returns a new Point2D corresponding to the given
float[] provided the parameter is non-null
and of size 2.
Returns null if the preconditions are not met.
array - to array to convertpublic static Point2D[] toPoint2D(float[][] array)
Returns a new Point2D[] of size N corresponding to
the given float[][] of size N-by-2.
Returns null if the parameter is null.
array - to array to convert
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||