| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.jfree.data.general.DatasetUtilitiespublic final class DatasetUtilitiesextends java.lang.ObjectMethod Summary | |
static double |
|
static double |
|
static CategoryDataset |
|
static CategoryDataset |
|
static CategoryDataset |
|
static CategoryDataset |
|
static PieDataset |
|
static PieDataset |
|
static PieDataset |
|
static PieDataset |
|
static PieDataset |
|
static PieDataset |
|
static Range |
|
static Range |
|
static Range |
|
static Number |
|
static Number |
|
static Number |
|
static Number |
|
static Number |
|
static Number |
|
static Number |
|
static Number |
|
static Range |
|
static Range |
|
static Range |
|
static Range |
|
static Range |
|
static Range |
|
static Range |
|
static Range |
|
static Range |
|
static boolean |
|
static boolean |
|
static boolean |
|
static Range |
|
static Range |
|
static Range |
|
static Range |
|
static Range |
|
static Range |
|
static Range |
|
static Range |
|
static XYDataset |
|
public static double calculatePieDatasetTotal(PieDataset dataset)
Calculates the total of all the values in aPieDataset. If the dataset contains negative ornullvalues, they are ignored.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The total.
public static double calculateStackTotal(TableXYDataset dataset, int item)
Calculates the total for the y-values in all series for a given item index.
- Parameters:
dataset- the dataset.item- the item index.
- Returns:
- The total.
- Since:
- 1.0.5
public static CategoryDataset createCategoryDataset(Comparable rowKey, KeyedValues rowData)
Creates aCategoryDatasetby copying the data from the suppliedKeyedValuesinstance.
- Parameters:
rowKey- the row key (nullnot permitted).rowData- the row data (nullnot permitted).
- Returns:
- A dataset.
public static CategoryDataset createCategoryDataset(Comparable[] rowKeys, Comparable[] columnKeys, double[][] data)
Creates aCategoryDatasetthat contains a copy of the data in an array (instances ofDoubleare created to represent the data items). Row and column keys are taken from the supplied arrays.
- Parameters:
rowKeys- the row keys (nullnot permitted).columnKeys- the column keys (nullnot permitted).data- the data.
- Returns:
- The dataset.
public static CategoryDataset createCategoryDataset(String rowKeyPrefix, String columnKeyPrefix, Number[][] data)
Creates aCategoryDatasetthat contains a copy of the data in an array. Row and column keys are created by appending 0, 1, 2, ... to the supplied prefixes.
- Parameters:
rowKeyPrefix- the row key prefix.columnKeyPrefix- the column key prefix.data- the data.
- Returns:
- The dataset.
public static CategoryDataset createCategoryDataset(String rowKeyPrefix, String columnKeyPrefix, double[][] data)
Creates aCategoryDatasetthat contains a copy of the data in an array (instances ofDoubleare created to represent the data items). Row and column keys are created by appending 0, 1, 2, ... to the supplied prefixes.
- Parameters:
rowKeyPrefix- the row key prefix.columnKeyPrefix- the column key prefix.data- the data.
- Returns:
- The dataset.
public static PieDataset createConsolidatedPieDataset(PieDataset source, Comparable key, double minimumPercent)
Creates a new pie dataset based on the supplied dataset, but modified by aggregating all the low value items (those whose value is lower than thepercentThreshold) into a single item with the key "Other".
- Parameters:
source- the source dataset (nullnot permitted).key- a new key for the aggregated items (nullnot permitted).minimumPercent- the percent threshold.
- Returns:
- The pie dataset with (possibly) aggregated items.
public static PieDataset createConsolidatedPieDataset(PieDataset source, Comparable key, double minimumPercent, int minItems)
Creates a new pie dataset based on the supplied dataset, but modified by aggregating all the low value items (those whose value is lower than thepercentThreshold) into a single item. The aggregated items are assigned the specified key. Aggregation only occurs if there are at leastminItemsitems to aggregate.
- Parameters:
source- the source dataset (nullnot permitted).key- the key to represent the aggregated items.minimumPercent- the percent threshold (ten percent is 0.10).minItems- only aggregate low values if there are at least this many.
- Returns:
- The pie dataset with (possibly) aggregated items.
public static PieDataset createPieDatasetForColumn(CategoryDataset dataset, Comparable columnKey)
Creates a pie dataset from a table dataset by taking all the values for a single column.
- Parameters:
dataset- the dataset (nullnot permitted).columnKey- the column key.
- Returns:
- A pie dataset.
public static PieDataset createPieDatasetForColumn(CategoryDataset dataset, int column)
Creates a pie dataset from aCategoryDatasetby taking all the values for a single column.
- Parameters:
dataset- the dataset (nullnot permitted).column- the column (zero-based index).
- Returns:
- A pie dataset.
public static PieDataset createPieDatasetForRow(CategoryDataset dataset, Comparable rowKey)
Creates a pie dataset from a table dataset by taking all the values for a single row.
- Parameters:
dataset- the dataset (nullnot permitted).rowKey- the row key.
- Returns:
- A pie dataset.
public static PieDataset createPieDatasetForRow(CategoryDataset dataset, int row)
Creates a pie dataset from a table dataset by taking all the values for a single row.
- Parameters:
dataset- the dataset (nullnot permitted).row- the row (zero-based index).
- Returns:
- A pie dataset.
public static Range findCumulativeRangeBounds(CategoryDataset dataset)
Calculates the range of values for a dataset where each item is the running total of the items for the current series.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range.
- See Also:
findRangeBounds(CategoryDataset)
public static Range findDomainBounds(XYDataset dataset)
Returns the range of values in the domain (x-values) of a dataset.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range of values (possibly
null).
public static Range findDomainBounds(XYDataset dataset, boolean includeInterval)
Returns the range of values in the domain (x-values) of a dataset.
- Parameters:
dataset- the dataset (nullnot permitted).includeInterval- determines whether or not the x-interval is taken into account (only applies if the dataset is anIntervalXYDataset).
- Returns:
- The range of values (possibly
null).
public static Number findMaximumDomainValue(XYDataset dataset)
Returns the maximum domain value for the specified dataset. This is easy if the dataset implements theDomainInfointerface (a good idea if there is an efficient way to determine the maximum value). Otherwise, it involves iterating over the entire data-set. Returnsnullif all the data values in the dataset arenull.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The maximum value (possibly
null).
public static Number findMaximumRangeValue(CategoryDataset dataset)
Returns the maximum range value for the specified dataset. This is easy if the dataset implements theRangeInfointerface (a good idea if there is an efficient way to determine the maximum value). Otherwise, it involves iterating over the entire data-set. Returnsnullif all the data values arenull.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The maximum value (possibly
null).
public static Number findMaximumRangeValue(XYDataset dataset)
Returns the maximum range value for the specified dataset. This is easy if the dataset implements theRangeInfointerface (a good idea if there is an efficient way to determine the maximum value). Otherwise, it involves iterating over the entire data-set. Returnsnullif all the data values arenull.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The maximum value (possibly
null).
public static Number findMaximumStackedRangeValue(CategoryDataset dataset)
Returns the maximum value in the dataset range, assuming that values in each category are "stacked".
- Parameters:
dataset- the dataset (nullpermitted).
- Returns:
- The maximum value (possibly
null).
public static Number findMinimumDomainValue(XYDataset dataset)
Finds the minimum domain (or X) value for the specified dataset. This is easy if the dataset implements theDomainInfointerface (a good idea if there is an efficient way to determine the minimum value). Otherwise, it involves iterating over the entire data-set. Returnsnullif all the data values in the dataset arenull.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The minimum value (possibly
null).
public static Number findMinimumRangeValue(CategoryDataset dataset)
Returns the minimum range value for the specified dataset. This is easy if the dataset implements theRangeInfointerface (a good idea if there is an efficient way to determine the minimum value). Otherwise, it involves iterating over the entire data-set. Returnsnullif all the data values in the dataset arenull.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The minimum value (possibly
null).
public static Number findMinimumRangeValue(XYDataset dataset)
Returns the minimum range value for the specified dataset. This is easy if the dataset implements theRangeInfointerface (a good idea if there is an efficient way to determine the minimum value). Otherwise, it involves iterating over the entire data-set. Returnsnullif all the data values in the dataset arenull.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The minimum value (possibly
null).
public static Number findMinimumStackedRangeValue(CategoryDataset dataset)
Returns the minimum value in the dataset range, assuming that values in each category are "stacked".
- Parameters:
dataset- the dataset.
- Returns:
- The minimum value.
public static Range findRangeBounds(CategoryDataset dataset)
Returns the range of values in the range for the dataset.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range (possibly
null).
public static Range findRangeBounds(CategoryDataset dataset, boolean includeInterval)
Returns the range of values in the range for the dataset.
- Parameters:
dataset- the dataset (nullnot permitted).includeInterval- a flag that determines whether or not the y-interval is taken into account.
- Returns:
- The range (possibly
null).
public static Range findRangeBounds(XYDataset dataset)
Returns the range of values in the range for the dataset. This method is the partner for thefindDomainBounds(XYDataset)method.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range (possibly
null).
public static Range findRangeBounds(XYDataset dataset, boolean includeInterval)
Returns the range of values in the range for the dataset. This method is the partner for thefindDomainBounds(XYDataset,boolean)method.
- Parameters:
dataset- the dataset (nullnot permitted).includeInterval- a flag that determines whether or not the y-interval is taken into account.
- Returns:
- The range (possibly
null).
public static Range findStackedRangeBounds(CategoryDataset dataset)
Returns the minimum and maximum values for the dataset's range (y-values), assuming that the series in one category are stacked.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range (
nullif the dataset contains no values).
public static Range findStackedRangeBounds(CategoryDataset dataset, double base)
Returns the minimum and maximum values for the dataset's range (y-values), assuming that the series in one category are stacked.
- Parameters:
dataset- the dataset (nullnot permitted).base- the base value for the bars.
- Returns:
- The range (
nullif the dataset contains no values).
public static Range findStackedRangeBounds(CategoryDataset dataset, KeyToGroupMap map)
Returns the minimum and maximum values for the dataset's range (y-values), assuming that the series in one category are stacked.
- Parameters:
dataset- the dataset.map- a structure that maps series to groups.
- Returns:
- The value range (
nullif the dataset contains no values).
public static Range findStackedRangeBounds(TableXYDataset dataset)
Returns the minimum and maximum values for the dataset's range, assuming that the series are stacked.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range ([0.0, 0.0] if the dataset contains no values).
public 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.
- Parameters:
dataset- the dataset (nullnot permitted).base- the base value.
- Returns:
- The range (
nullif the dataset contains no values).
public static boolean isEmptyOrNull(CategoryDataset dataset)
Returnstrueif the dataset is empty (ornull), andfalseotherwise.
- Parameters:
dataset- the dataset (nullpermitted).
- Returns:
- A boolean.
public static boolean isEmptyOrNull(PieDataset dataset)
Returnstrueif the dataset is empty (ornull), andfalseotherwise.
- Parameters:
dataset- the dataset (nullpermitted).
- Returns:
- A boolean.
public static boolean isEmptyOrNull(XYDataset dataset)
Returnstrueif the dataset is empty (ornull), andfalseotherwise.
- Parameters:
dataset- the dataset (nullpermitted).
- Returns:
- A boolean.
public static Range iterateCategoryRangeBounds(CategoryDataset dataset, boolean includeInterval)
Deprecated. As of 1.0.10, use
iterateRangeBounds(CategoryDataset,boolean).Iterates over the data item of the category dataset to find the range bounds.
- Parameters:
dataset- the dataset (nullnot permitted).includeInterval- a flag that determines whether or not the y-interval is taken into account.
- Returns:
- The range (possibly
null).
public static Range iterateDomainBounds(XYDataset dataset)
Iterates over the items in anXYDatasetto find the range of x-values. If the dataset is an instance ofIntervalXYDataset, the starting and ending x-values will be used for the bounds calculation.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range (possibly
null).
public static Range iterateDomainBounds(XYDataset dataset, boolean includeInterval)
Iterates over the items in anXYDatasetto find the range of x-values.
- Parameters:
dataset- the dataset (nullnot permitted).includeInterval- a flag that determines, for anIntervalXYDataset, whether the x-interval or just the x-value is used to determine the overall range.
- Returns:
- The range (possibly
null).
public static Range iterateRangeBounds(CategoryDataset dataset)
Iterates over the data item of the category dataset to find the range bounds.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range (possibly
null).
- Since:
- 1.0.10
public static Range iterateRangeBounds(CategoryDataset dataset, boolean includeInterval)
Iterates over the data item of the category dataset to find the range bounds.
- Parameters:
dataset- the dataset (nullnot permitted).includeInterval- a flag that determines whether or not the y-interval is taken into account.
- Returns:
- The range (possibly
null).
- Since:
- 1.0.10
public static Range iterateRangeBounds(XYDataset dataset)
Iterates over the data item of the xy dataset to find the range bounds.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range (possibly
null).
- Since:
- 1.0.10
public static Range iterateRangeBounds(XYDataset dataset, boolean includeInterval)
Iterates over the data items of the xy dataset to find the range bounds.
- Parameters:
dataset- the dataset (nullnot permitted).includeInterval- a flag that determines, for anIntervalXYDataset, whether the y-interval or just the y-value is used to determine the overall range.
- Returns:
- The range (possibly
null).
- Since:
- 1.0.10
public static Range iterateXYRangeBounds(XYDataset dataset)
Deprecated. As of 1.0.10, use
iterateRangeBounds(XYDataset).Iterates over the data item of the xy dataset to find the range bounds.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range (possibly
null).
public static XYDataset sampleFunction2D(Function2D f, double start, double end, int samples, Comparable seriesKey)
Creates anXYDatasetby sampling the specified function over a fixed range.
- Parameters:
f- the function (nullnot 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 (nullnot permitted).
- Returns:
- A dataset.