public abstract class DataUtilities extends java.lang.Object
DatasetUtilities
).Constructor and Description |
---|
DataUtilities() |
Modifier and Type | Method and Description |
---|---|
static double |
calculateColumnTotal(Values2D data,
int column)
Returns the total of the values in one column of the supplied data
table.
|
static double |
calculateColumnTotal(Values2D data,
int column,
int[] validRows)
Returns the total of the values in one column of the supplied data
table by taking only the row numbers in the array into account.
|
static double |
calculateRowTotal(Values2D data,
int row)
Returns the total of the values in one row of the supplied data
table.
|
static double |
calculateRowTotal(Values2D data,
int row,
int[] validCols)
Returns the total of the values in one row of the supplied data
table by taking only the column numbers in the array into account.
|
static double[][] |
clone(double[][] source)
Returns a clone of the specified array.
|
static java.lang.Number[] |
createNumberArray(double[] data)
Constructs an array of
Number objects from an array of
double primitives. |
static java.lang.Number[][] |
createNumberArray2D(double[][] data)
Constructs an array of arrays of
Number objects from a
corresponding structure containing double primitives. |
static boolean |
equal(double[][] a,
double[][] b)
Tests two arrays for equality.
|
static KeyedValues |
getCumulativePercentages(KeyedValues data)
Returns a
KeyedValues instance that contains the cumulative
percentage values for the data in another KeyedValues instance. |
public DataUtilities()
public static boolean equal(double[][] a, double[][] b)
a
- the first array (null
permitted).b
- the second array (null
permitted).public static double[][] clone(double[][] source)
source
- the source array (null
not permitted).public static double calculateColumnTotal(Values2D data, int column)
data
- the table of values (null
not permitted).column
- the column index (zero-based).public static double calculateColumnTotal(Values2D data, int column, int[] validRows)
data
- the table of values (null
not permitted).column
- the column index (zero-based).validRows
- the array with valid rows (zero-based).public static double calculateRowTotal(Values2D data, int row)
data
- the table of values (null
not permitted).row
- the row index (zero-based).public static double calculateRowTotal(Values2D data, int row, int[] validCols)
data
- the table of values (null
not permitted).row
- the row index (zero-based).validCols
- the array with valid cols (zero-based).public static java.lang.Number[] createNumberArray(double[] data)
Number
objects from an array of
double
primitives.data
- the data (null
not permitted).Double
.public static java.lang.Number[][] createNumberArray2D(double[][] data)
Number
objects from a
corresponding structure containing double
primitives.data
- the data (null
not permitted).Double
.public static KeyedValues getCumulativePercentages(KeyedValues data)
KeyedValues
instance that contains the cumulative
percentage values for the data in another KeyedValues
instance.
The percentages are values between 0.0 and 1.0 (where 1.0 = 100%).
data
- the data (null
not permitted).