public final class DatasetUtilities
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static double |
calculateStackTotal(TableXYDataset dataset,
int item)
Calculates the total for the y-values in all series for a given item
index.
|
static Range |
findDomainBounds(XYDataset dataset)
Returns the range of values in the domain (x-values) of a dataset.
|
static Range |
findDomainBounds(XYDataset dataset,
boolean includeInterval)
Returns the range of values in the domain (x-values) of a dataset.
|
static Range |
findDomainBounds(XYDataset dataset,
java.util.List visibleSeriesKeys,
boolean includeInterval)
Returns the bounds of the x-values in the specified
dataset
taking into account only the visible series and including any x-interval
if requested. |
static int[] |
findItemIndicesForX(XYDataset dataset,
int series,
double x)
Finds the indices of the the items in the dataset that span the
specified x-value.
|
static java.lang.Number |
findMaximumDomainValue(XYDataset dataset)
Returns the maximum domain value for the specified dataset.
|
static java.lang.Number |
findMaximumRangeValue(XYDataset dataset)
Returns the maximum range value for the specified dataset.
|
static java.lang.Number |
findMinimumDomainValue(XYDataset dataset)
Finds the minimum domain (or X) value for the specified dataset.
|
static java.lang.Number |
findMinimumRangeValue(XYDataset dataset)
Returns the minimum range value for the specified dataset.
|
static Range |
findRangeBounds(XYDataset dataset)
Returns the range of values in the range for the dataset.
|
static Range |
findRangeBounds(XYDataset dataset,
boolean includeInterval)
Returns the range of values in the range for the dataset.
|
static Range |
findRangeBounds(XYDataset dataset,
java.util.List visibleSeriesKeys,
Range xRange,
boolean includeInterval)
Finds the bounds of the y-values in the specified dataset, including
only those series that are listed in visibleSeriesKeys, and those items
whose x-values fall within the specified range.
|
static Range |
findStackedRangeBounds(TableXYDataset dataset)
Returns the minimum and maximum values for the dataset's range,
assuming that the series are stacked.
|
static Range |
findStackedRangeBounds(TableXYDataset dataset,
double base)
Returns the minimum and maximum values for the dataset's range,
assuming that the series are stacked, using the specified base value.
|
static double |
findYValue(XYDataset dataset,
int series,
double x)
Returns the interpolated value of y that corresponds to the specified
x-value in the given series.
|
static Range |
findZBounds(XYZDataset dataset)
Returns the range of values in the z-dimension for the dataset.
|
static Range |
findZBounds(XYZDataset dataset,
boolean includeInterval)
Returns the range of values in the z-dimension for the dataset.
|
static Range |
findZBounds(XYZDataset dataset,
java.util.List visibleSeriesKeys,
Range xRange,
boolean includeInterval)
Finds the bounds of the z-values in the specified dataset, including
only those series that are listed in visibleSeriesKeys, and those items
whose x-values fall within the specified range.
|
static boolean |
isEmptyOrNull(XYDataset dataset)
Returns
true if the dataset is empty (or null),
and false otherwise. |
static Range |
iterateDomainBounds(XYDataset dataset)
Iterates over the items in an
XYDataset to find
the range of x-values. |
static Range |
iterateDomainBounds(XYDataset dataset,
boolean includeInterval)
Iterates over the items in an
XYDataset to find
the range of x-values. |
static Range |
iterateRangeBounds(XYDataset dataset)
Iterates over the data item of the xy dataset to find
the range bounds.
|
static Range |
iterateRangeBounds(XYDataset dataset,
boolean includeInterval)
Iterates over the data items of the xy dataset to find
the range bounds.
|
static Range |
iterateToFindDomainBounds(XYDataset dataset,
java.util.List visibleSeriesKeys,
boolean includeInterval)
Returns the range of x-values in the specified dataset for the
data items belonging to the visible series.
|
static Range |
iterateToFindRangeBounds(XYDataset dataset,
java.util.List visibleSeriesKeys,
Range xRange,
boolean includeInterval)
Returns the range of y-values in the specified dataset for the
data items belonging to the visible series and with x-values in the
given range.
|
static Range |
iterateToFindZBounds(XYZDataset dataset,
java.util.List visibleSeriesKeys,
Range xRange,
boolean includeInterval)
Returns the range of z-values in the specified dataset for the
data items belonging to the visible series and with x-values in the
given range.
|
static Range |
iterateXYRangeBounds(XYDataset dataset)
Deprecated.
As of 1.0.10, use
iterateRangeBounds(XYDataset). |
static Range |
iterateZBounds(XYZDataset dataset)
Iterates over the data item of the xyz dataset to find
the z-dimension bounds.
|
static Range |
iterateZBounds(XYZDataset dataset,
boolean includeInterval)
Iterates over the data items of the xyz dataset to find
the z-dimension bounds.
|
static XYDataset |
sampleFunction2D(Function2D f,
double start,
double end,
int samples,
java.lang.Comparable seriesKey)
Creates an
XYDataset by sampling the specified function over a
fixed range. |
static XYSeries |
sampleFunction2DToSeries(Function2D f,
double start,
double end,
int samples,
java.lang.Comparable seriesKey)
Creates an
XYSeries by sampling the specified function over a
fixed range. |
public static XYDataset sampleFunction2D(Function2D f, double start, double end, int samples, java.lang.Comparable seriesKey)
XYDataset by sampling the specified function over a
fixed range.f - the function (null not permitted).start - the start value for the range.end - the end value for the range.samples - the number of sample points (must be > 1).seriesKey - the key to give the resulting series
(null not permitted).public static XYSeries sampleFunction2DToSeries(Function2D f, double start, double end, int samples, java.lang.Comparable seriesKey)
XYSeries by sampling the specified function over a
fixed range.f - the function (null not permitted).start - the start value for the range.end - the end value for the range.samples - the number of sample points (must be > 1).seriesKey - the key to give the resulting series
(null not permitted).public static boolean isEmptyOrNull(XYDataset dataset)
true if the dataset is empty (or null),
and false otherwise.dataset - the dataset (null permitted).public static Range findDomainBounds(XYDataset dataset)
dataset - the dataset (null not permitted).null).public static Range findDomainBounds(XYDataset dataset, boolean includeInterval)
dataset - the dataset (null not permitted).includeInterval - determines whether or not the x-interval is taken
into account (only applies if the dataset is an
IntervalXYDataset).null).public static Range findDomainBounds(XYDataset dataset, java.util.List visibleSeriesKeys, boolean includeInterval)
dataset
taking into account only the visible series and including any x-interval
if requested.dataset - the dataset (null not permitted).visibleSeriesKeys - the visible series keys (null
not permitted).includeInterval - include the x-interval (if any)?null if the dataset contains no
values.public static Range iterateDomainBounds(XYDataset dataset)
XYDataset to find
the range of x-values. If the dataset is an instance of
IntervalXYDataset, the starting and ending x-values
will be used for the bounds calculation.dataset - the dataset (null not permitted).null).public static Range iterateDomainBounds(XYDataset dataset, boolean includeInterval)
XYDataset to find
the range of x-values.dataset - the dataset (null not permitted).includeInterval - a flag that determines, for an
IntervalXYDataset, whether the x-interval or just the
x-value is used to determine the overall range.null).public static Range findRangeBounds(XYDataset dataset)
findDomainBounds(XYDataset) method.dataset - the dataset (null not permitted).null).public static Range findRangeBounds(XYDataset dataset, boolean includeInterval)
findDomainBounds(XYDataset, boolean)
method.dataset - the dataset (null not permitted).includeInterval - a flag that determines whether or not the
y-interval is taken into account.null).public static Range findRangeBounds(XYDataset dataset, java.util.List visibleSeriesKeys, Range xRange, boolean includeInterval)
dataset - the dataset (null not permitted).visibleSeriesKeys - the keys for the visible series
(null not permitted).xRange - the x-range (null not permitted).includeInterval - include the y-interval (if the dataset has a
y-interval).public static Range iterateXYRangeBounds(XYDataset dataset)
iterateRangeBounds(XYDataset).dataset - the dataset (null not permitted).null).public static Range iterateRangeBounds(XYDataset dataset)
dataset - the dataset (null not permitted).null).public static Range iterateRangeBounds(XYDataset dataset, boolean includeInterval)
dataset - the dataset (null not permitted).includeInterval - a flag that determines, for an
IntervalXYDataset, whether the y-interval or just the
y-value is used to determine the overall range.null).public static Range findZBounds(XYZDataset dataset)
findRangeBounds(XYDataset)
and findDomainBounds(XYDataset) methods.dataset - the dataset (null not permitted).null).public static Range findZBounds(XYZDataset dataset, boolean includeInterval)
findRangeBounds(XYDataset, boolean) and
findDomainBounds(XYDataset, boolean) methods.dataset - the dataset (null not permitted).includeInterval - a flag that determines whether or not the
z-interval is taken into account.null).public static Range findZBounds(XYZDataset dataset, java.util.List visibleSeriesKeys, Range xRange, boolean includeInterval)
dataset - the dataset (null not permitted).visibleSeriesKeys - the keys for the visible series
(null not permitted).xRange - the x-range (null not permitted).includeInterval - include the z-interval (if the dataset has a
z-interval).public static Range iterateZBounds(XYZDataset dataset)
dataset - the dataset (null not permitted).null).public static Range iterateZBounds(XYZDataset dataset, boolean includeInterval)
dataset - the dataset (null not permitted).includeInterval - include the z-interval (if the dataset has a
z-interval.null).public static Range iterateToFindDomainBounds(XYDataset dataset, java.util.List visibleSeriesKeys, boolean includeInterval)
dataset - the dataset (null not permitted).visibleSeriesKeys - the visible series keys (null not
permitted).includeInterval - a flag that determines whether or not the
y-interval for the dataset is included (this only applies if the
dataset is an instance of IntervalXYDataset).null).public static Range iterateToFindRangeBounds(XYDataset dataset, java.util.List visibleSeriesKeys, Range xRange, boolean includeInterval)
dataset - the dataset (null not permitted).visibleSeriesKeys - the visible series keys (null not
permitted).xRange - the x-range (null not permitted).includeInterval - a flag that determines whether or not the
y-interval for the dataset is included (this only applies if the
dataset is an instance of IntervalXYDataset).null).public static Range iterateToFindZBounds(XYZDataset dataset, java.util.List visibleSeriesKeys, Range xRange, boolean includeInterval)
dataset - the dataset (null not permitted).visibleSeriesKeys - the visible series keys (null not
permitted).xRange - the x-range (null not permitted).includeInterval - a flag that determines whether or not the
z-interval for the dataset is included (this only applies if the
dataset has an interval, which is currently not supported).null).public static java.lang.Number findMinimumDomainValue(XYDataset dataset)
DomainInfo interface (a
good idea if there is an efficient way to determine the minimum value).
Otherwise, it involves iterating over the entire data-set.
Returns null if all the data values in the dataset are
null.
dataset - the dataset (null not permitted).null).public static java.lang.Number findMaximumDomainValue(XYDataset dataset)
DomainInfo interface (a good
idea if there is an efficient way to determine the maximum value).
Otherwise, it involves iterating over the entire data-set. Returns
null if all the data values in the dataset are
null.dataset - the dataset (null not permitted).null).public static java.lang.Number findMinimumRangeValue(XYDataset dataset)
RangeInfo interface (a good
idea if there is an efficient way to determine the minimum value).
Otherwise, it involves iterating over the entire data-set. Returns
null if all the data values in the dataset are
null.dataset - the dataset (null not permitted).null).public static java.lang.Number findMaximumRangeValue(XYDataset dataset)
RangeInfo interface (a good
idea if there is an efficient way to determine the maximum value).
Otherwise, it involves iterating over the entire data-set. Returns
null if all the data values are null.dataset - the dataset (null not permitted).null).public static Range findStackedRangeBounds(TableXYDataset dataset)
dataset - the dataset (null not permitted).public static Range findStackedRangeBounds(TableXYDataset dataset, double base)
dataset - the dataset (null not permitted).base - the base value.null if the dataset contains no values).public static double calculateStackTotal(TableXYDataset dataset, int item)
dataset - the dataset.item - the item index.public static double findYValue(XYDataset dataset, int series, double x)
Double.NaN.dataset - the dataset (null not permitted).series - the series index.x - the x-value.public static int[] findItemIndicesForX(XYDataset dataset, int series, double x)
int[] {i, i});int[] {i, i+1});int[] {-1, -1}.dataset - the dataset (null not permitted).series - the series index.x - the x-value.findYValue(org.jfree.data.xy.XYDataset, int, double)