public class DataUtils extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <S extends java.lang.Comparable<S>> |
count(KeyedValues3D<S,?,?,?> data,
S seriesKey)
Returns the count of the non-
null entries in the dataset
for the specified series. |
static <C extends java.lang.Comparable<C>> |
countForColumn(KeyedValues3D<?,?,C,?> data,
C columnKey)
Returns the count of the non-
null entries in the dataset
for the specified column (all series). |
static <R extends java.lang.Comparable<R>> |
countForRow(KeyedValues3D<?,R,?,?> data,
R rowKey)
Returns the count of the non-
null entries in the dataset
for the specified row (all series). |
static <S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>> |
extractXYZDatasetFromColumns(KeyedValues3D<S,R,C,? extends java.lang.Number> source,
C xColKey,
C yColKey,
C zColKey)
Creates an
XYZDataset by extracting values from specified
columns in a KeyedValues3D instance, across all the available
rows (items where any of the x, y or z values is null are
skipped). |
static <S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>> |
extractXYZDatasetFromColumns(KeyedValues3D<S,R,C,? extends java.lang.Number> source,
C xColKey,
C yColKey,
C zColKey,
NullConversion nullConversion,
java.util.List<KeyedValues3DItemKey> exceptions)
Creates an
XYZDataset by extracting values from specified
columns in a KeyedValues3D instance. |
static <S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>> |
extractXYZDatasetFromRows(KeyedValues3D<S,R,C,? extends java.lang.Number> source,
R xRowKey,
R yRowKey,
R zRowKey)
Creates an
XYZDataset by extracting values from specified
rows in a KeyedValues3D instance, across all the available
columns (items where any of the x, y or z values is null
are skipped). |
static <S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>> |
extractXYZDatasetFromRows(KeyedValues3D<S,R,C,? extends java.lang.Number> source,
R xRowKey,
R yRowKey,
R zRowKey,
NullConversion nullConversion,
java.util.List<KeyedValues3DItemKey> exceptions)
Creates an
XYZDataset by extracting values from specified
rows in a KeyedValues3D instance. |
static Range |
findStackedValueRange(Values3D<? extends java.lang.Number> data)
Finds the range of values in the dataset considering that each series
is stacked on top of the other.
|
static Range |
findStackedValueRange(Values3D<? extends java.lang.Number> data,
double base)
Finds the range of values in the dataset considering that each series
is stacked on top of the others, starting at the base value.
|
static Range |
findValueRange(Values3D<? extends java.lang.Number> data)
Returns the range of values in the specified data structure (a three
dimensional cube).
|
static Range |
findValueRange(Values3D<? extends java.lang.Number> data,
double base)
Returns the range of values in the specified data cube, or
null if there is no data. |
static Range |
findValueRange(Values3D<? extends java.lang.Number> data,
double base,
boolean finite)
/**
Returns the range of values in the specified data cube, or
null if there is no data. |
static Range |
findXRange(XYZDataset dataset)
Returns the range of x-values in the dataset by iterating over all
values (and ignoring
Double.NaN and infinite values). |
static Range |
findXRange(XYZDataset dataset,
double inc)
Returns the range of x-values in the dataset by iterating over all
values (and ignoring
Double.NaN values). |
static Range |
findXRange(XYZDataset dataset,
double inc,
boolean finite)
Returns the range of x-values in the dataset by iterating over all
values (and ignoring
Double.NaN values). |
static Range |
findYRange(XYZDataset dataset)
Returns the range of y-values in the dataset by iterating over all
values (and ignoring
Double.NaN and infinite values). |
static Range |
findYRange(XYZDataset dataset,
double inc)
Returns the range of y-values in the dataset by iterating over all
values (and ignoring
Double.NaN values). |
static Range |
findYRange(XYZDataset dataset,
double inc,
boolean finite)
Returns the range of y-values in the dataset by iterating over all
values (and ignoring
Double.NaN values). |
static Range |
findZRange(XYZDataset dataset)
Returns the range of z-values in the dataset by iterating over all
values (and ignoring
Double.NaN and infinite values). |
static Range |
findZRange(XYZDataset dataset,
double inc)
Returns the range of z-values in the dataset by iterating over all
values (and ignoring
Double.NaN values). |
static Range |
findZRange(XYZDataset dataset,
double inc,
boolean finite)
Returns the range of z-values in the dataset by iterating over all
values (and ignoring
Double.NaN values). |
static double[] |
stackSubTotal(Values3D<? extends java.lang.Number> data,
double base,
int series,
int row,
int column)
Returns the positive and negative subtotals of the values for all the
series preceding the specified series.
|
static <S extends java.lang.Comparable<S>> |
total(KeyedValues3D<S,?,?,? extends java.lang.Number> data,
S seriesKey)
Returns the total of the non-
null values in the dataset
for the specified series. |
static double |
total(Values<java.lang.Number> values)
Returns the total of the values in the list.
|
static <S extends java.lang.Comparable<S>> |
total(XYZDataset<S> data,
S seriesKey)
Returns the total of the non-
NaN entries in the dataset
for the specified series. |
static <C extends java.lang.Comparable<C>> |
totalForColumn(KeyedValues3D<?,?,C,? extends java.lang.Number> data,
C columnKey)
Returns the total of the non-
null entries in the dataset
for the specified column (all series). |
static <R extends java.lang.Comparable<R>> |
totalForRow(KeyedValues3D<?,R,?,? extends java.lang.Number> data,
R rowKey)
Returns the total of the non-
null entries in the dataset
for the specified row (all series). |
public static double total(Values<java.lang.Number> values)
null
values are ignored.values - the values (null not permitted).public static <S extends java.lang.Comparable<S>> int count(KeyedValues3D<S,?,?,?> data, S seriesKey)
null entries in the dataset
for the specified series. An IllegalArgumentException is
thrown if the seriesKey is not present in the data.S - the series key (must implement Comparable).data - the dataset (null not permitted).seriesKey - the series key (null not permitted).public static <R extends java.lang.Comparable<R>> int countForRow(KeyedValues3D<?,R,?,?> data, R rowKey)
null entries in the dataset
for the specified row (all series).R - the row key (must implement Comparable).data - the dataset (null not permitted).rowKey - the row key (null not permitted).public static <C extends java.lang.Comparable<C>> int countForColumn(KeyedValues3D<?,?,C,?> data, C columnKey)
null entries in the dataset
for the specified column (all series).C - the column key (must implement Comparable).data - the dataset (null not permitted).columnKey - the column key (null not permitted).public static <S extends java.lang.Comparable<S>> double total(KeyedValues3D<S,?,?,? extends java.lang.Number> data, S seriesKey)
null values in the dataset
for the specified series. If there is no series with the specified
key, this method will throw an IllegalArgumentException.S - the series key (must implement Comparable).data - the dataset (null not permitted).seriesKey - the series key (null not permitted).public static <R extends java.lang.Comparable<R>> double totalForRow(KeyedValues3D<?,R,?,? extends java.lang.Number> data, R rowKey)
null entries in the dataset
for the specified row (all series).R - the row key (must implement Comparable).data - the dataset (null not permitted).rowKey - the row key (null not permitted).public static <C extends java.lang.Comparable<C>> double totalForColumn(KeyedValues3D<?,?,C,? extends java.lang.Number> data, C columnKey)
null entries in the dataset
for the specified column (all series).C - the column key (must implement Comparable).data - the dataset (null not permitted).columnKey - the row key (null not permitted).public static Range findValueRange(Values3D<? extends java.lang.Number> data)
null.data - the data (null not permitted).null).public static Range findValueRange(Values3D<? extends java.lang.Number> data, double base)
null if there is no data. The range will be expanded, if
required, to include the base value (unless it
is Double.NaN in which case it is ignored).data - the data (null not permitted).base - a value that must be included in the range (often 0). This
argument is ignored if it is Double.NaN.null).public static Range findValueRange(Values3D<? extends java.lang.Number> data, double base, boolean finite)
null if there is no data. The range will be expanded, if
required, to include the base value (unless it
is Double.NaN in which case it is ignored).data - the data (null not permitted).base - a value that must be included in the range (often 0). This
argument is ignored if it is Double.NaN.finite - if true infinite values will be ignored.null).public static Range findStackedValueRange(Values3D<? extends java.lang.Number> data)
data - the data (null not permitted).public static Range findStackedValueRange(Values3D<? extends java.lang.Number> data, double base)
data - the data values (null not permitted).base - the base value.public static double[] stackSubTotal(Values3D<? extends java.lang.Number> data, double base, int series, int row, int column)
data - the data (null not permitted).base - the initial base value (normally 0.0, but the
values can be stacked from a different starting point).series - the index of the current series (series with lower indices
are included in the sub-totals).row - the row index of the required item.column - the column index of the required item.result[0] is the subtotal of
the negative data items, and result[1] is the subtotal
of the positive data items.public static <S extends java.lang.Comparable<S>> double total(XYZDataset<S> data, S seriesKey)
NaN entries in the dataset
for the specified series.S - the series key (must implement Comparable).data - the dataset (null not permitted).seriesKey - the series key (null not permitted).public static Range findXRange(XYZDataset dataset)
Double.NaN and infinite values).
If there are no values eligible for inclusion in the range, this method
returns null.dataset - the dataset (null not permitted).null).public static Range findXRange(XYZDataset dataset, double inc)
Double.NaN values). The range will be
extended if necessary to include inc (unless it is
Double.NaN in which case it is ignored). Infinite values
in the dataset will be ignored. If there are no values eligible for
inclusion in the range, this method returns null.dataset - the dataset (null not permitted).inc - an additional x-value to include.null).public static Range findXRange(XYZDataset dataset, double inc, boolean finite)
Double.NaN values). The range will be
extended if necessary to include inc (unless it is
Double.NaN in which case it is ignored). If the
finite flag is set, infinite values in the dataset will be
ignored. If there are no values eligible for inclusion in the range,
this method returns null.dataset - the dataset (null not permitted).inc - an additional x-value to include.finite - a flag indicating whether to exclude infinite values.null).public static Range findYRange(XYZDataset dataset)
Double.NaN and infinite values).
If there are no values eligible for inclusion in the range, this method
returns null.dataset - the dataset (null not permitted).public static Range findYRange(XYZDataset dataset, double inc)
Double.NaN values). The range will be
extended if necessary to include inc (unless it is
Double.NaN in which case it is ignored). Infinite values
in the dataset will be ignored. If there are no values eligible for
inclusion in the range, this method returns null.dataset - the dataset (null not permitted).inc - an additional x-value to include.public static Range findYRange(XYZDataset dataset, double inc, boolean finite)
Double.NaN values). The range will be
extended if necessary to include inc (unless it is
Double.NaN in which case it is ignored). If the
finite flag is set, infinite values in the dataset will be
ignored. If there are no values eligible for inclusion in the range,
this method returns null.dataset - the dataset (null not permitted).inc - an additional y-value to include.finite - a flag indicating whether to exclude infinite values.null).public static Range findZRange(XYZDataset dataset)
Double.NaN and infinite values).
If there are no values eligible for inclusion in the range, this method
returns null.dataset - the dataset (null not permitted).null).public static Range findZRange(XYZDataset dataset, double inc)
Double.NaN values). The range will be
extended if necessary to include inc (unless it is
Double.NaN in which case it is ignored). Infinite values
in the dataset will be ignored. If there are no values eligible for
inclusion in the range, this method returns null.dataset - the dataset (null not permitted).inc - an additional x-value to include.null).public static Range findZRange(XYZDataset dataset, double inc, boolean finite)
Double.NaN values). The range will be
extended if necessary to include inc (unless it is
Double.NaN in which case it is ignored). If the
finite flag is set, infinite values in the dataset will be
ignored. If there are no values eligible for inclusion in the range,
this method returns null.dataset - the dataset (null not permitted).inc - an additional z-value to include.finite - a flag indicating whether to exclude infinite values.null).public static <S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>> XYZDataset extractXYZDatasetFromRows(KeyedValues3D<S,R,C,? extends java.lang.Number> source, R xRowKey, R yRowKey, R zRowKey)
XYZDataset by extracting values from specified
rows in a KeyedValues3D instance, across all the available
columns (items where any of the x, y or z values is null
are skipped). The new dataset contains a copy of the data and is
completely independent of the source dataset.
CategoryDataset3D is an extension of
KeyedValues3D so you can use this method for any implementation
of the CategoryDataset3D interface.S - the series key (must implement Comparable).R - the row key (must implement Comparable).C - the column key (must implement Comparable).source - the source data (null not permitted).xRowKey - the row key for x-values (null not permitted).yRowKey - the row key for y-values (null not permitted).zRowKey - the row key for z-values (null not permitted).public static <S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>> XYZDataset extractXYZDatasetFromRows(KeyedValues3D<S,R,C,? extends java.lang.Number> source, R xRowKey, R yRowKey, R zRowKey, NullConversion nullConversion, java.util.List<KeyedValues3DItemKey> exceptions)
XYZDataset by extracting values from specified
rows in a KeyedValues3D instance. The new dataset contains
a copy of the data and is completely independent of the
source dataset. Note that CategoryDataset3D is an
extension of KeyedValues3D.
null
values. The caller may pass in an exceptions list (
normally empty) that will be populated with the keys of the items that
receive special handling, if any.S - the series key (must implement Comparable).R - the row key (must implement Comparable).C - the column key (must implement Comparable).source - the source data (null not permitted).xRowKey - the row key for x-values (null not permitted).yRowKey - the row key for y-values (null not permitted).zRowKey - the row key for z-values (null not permitted).nullConversion - specifies the treatment for null
values in the dataset (null not permitted).exceptions - a list that, if not null, will be populated with
keys for the items in the source dataset that contain
null values (null permitted).public static <S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>> XYZDataset<S> extractXYZDatasetFromColumns(KeyedValues3D<S,R,C,? extends java.lang.Number> source, C xColKey, C yColKey, C zColKey)
XYZDataset by extracting values from specified
columns in a KeyedValues3D instance, across all the available
rows (items where any of the x, y or z values is null are
skipped). The new dataset contains a copy of the data and is completely
independent of the source dataset.
CategoryDataset3D is an extension of
KeyedValues3D so you can use this method for any implementation
of the CategoryDataset3D interface.S - the series key (must implement Comparable).R - the row key (must implement Comparable).C - the column key (must implement Comparable).source - the source data (null not permitted).xColKey - the column key for x-values (null not permitted).yColKey - the column key for y-values (null not permitted).zColKey - the column key for z-values (null not permitted).public static <S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>> XYZDataset<S> extractXYZDatasetFromColumns(KeyedValues3D<S,R,C,? extends java.lang.Number> source, C xColKey, C yColKey, C zColKey, NullConversion nullConversion, java.util.List<KeyedValues3DItemKey> exceptions)
XYZDataset by extracting values from specified
columns in a KeyedValues3D instance. The new dataset contains
a copy of the data and is completely independent of the
source dataset. Note that CategoryDataset3D is an
extension of KeyedValues3D.
null
values. The caller may pass in an exceptions list (
normally empty) that will be populated with the keys of the items that
receive special handling, if any.S - the series key (must implement Comparable).R - the row key (must implement Comparable).C - the column key (must implement Comparable).source - the source data (null not permitted).xColKey - the column key for x-values (null not permitted).yColKey - the column key for y-values (null not permitted).zColKey - the column key for z-values (null not permitted).nullConversion - specifies the treatment for null
values in the dataset (null not permitted).exceptions - a list that, if not null, will be populated with
keys for the items in the source dataset that contain
null values (null permitted).