com.jrefinery.data
Class DatasetUtilities

java.lang.Object
  extended by com.jrefinery.data.DatasetUtilities
Direct Known Subclasses:
SiamDatasetUtilities

public class DatasetUtilities
extends java.lang.Object

This class contains static methods that perform various useful functions relating to datasets.


Constructor Summary
DatasetUtilities()
           
 
Method Summary
static java.lang.Number[] createNumberArray(double[] data)
          Constructs an array of Number objects from an array of doubles.
static java.lang.Number[][] createNumberArray2D(double[][] data)
          Constructs an array of arrays of Number objects from a corresponding structure containing double primitives.
static PieDataset createPieDataset(CategoryDataset data, int series)
          Creates a pie dataset from a category dataset by taking all the values for a single series.
static PieDataset createPieDataset(CategoryDataset data, java.lang.Object category)
          Creates a pie dataset from a category dataset by taking all the values (across series) for a single category.
static Range getDomainExtent(Dataset data)
          Returns the range of values in the domain for the dataset.
static java.lang.Number getMaximumDomainValue(Dataset data)
          Returns the maximum domain value for the specified dataset.
static java.lang.Number getMaximumRangeValue(Dataset data)
          Returns the maximum range value for the specified dataset.
static java.lang.Number getMaximumStackedRangeValue(CategoryDataset data)
          Returns the maximum value in the dataset range, assuming that values in each category are "stacked".
static java.lang.Number getMinimumDomainValue(Dataset data)
          Returns the minimum domain value for the specified dataset.
static java.lang.Number getMinimumRangeValue(Dataset data)
          Returns the minimum range value for the specified dataset.
static java.lang.Number getMinimumStackedRangeValue(CategoryDataset data)
          Returns the minimum value in the dataset range, assuming that values in each category are "stacked".
static Range getRangeExtent(Dataset data)
          Returns the range of values in the range for the dataset.
static Range getStackedRangeExtent(CategoryDataset data)
          Returns the range of values for the range (as in domain/range) of the dataset, assuming that the series in one category are stacked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatasetUtilities

public DatasetUtilities()
Method Detail

createNumberArray

public static java.lang.Number[] createNumberArray(double[] data)
Constructs an array of Number objects from an array of doubles.

Parameters:
data - The data.

createNumberArray2D

public static java.lang.Number[][] createNumberArray2D(double[][] data)
Constructs an array of arrays of Number objects from a corresponding structure containing double primitives.

Parameters:
data - The data.

getDomainExtent

public static Range getDomainExtent(Dataset data)
Returns the range of values in the domain for the dataset.

Parameters:
data - The dataset.
Returns:
The range of values.

getRangeExtent

public static Range getRangeExtent(Dataset data)
Returns the range of values in the range for the dataset. This method is the partner for the getDomainExtent method.

Parameters:
data - The dataset.

getMinimumDomainValue

public static java.lang.Number getMinimumDomainValue(Dataset data)
Returns the minimum domain value for the specified dataset.

This is easy if the dataset implements the 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:
The minimum domain value in the dataset (or null if all the values in the dataset are null).

getMaximumDomainValue

public static java.lang.Number getMaximumDomainValue(Dataset data)
Returns the maximum domain value for the specified dataset.

This is easy if the dataset implements the 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:
The maximum domain value in the dataset (or null if all the values in the dataset are null).

getMinimumRangeValue

public static java.lang.Number getMinimumRangeValue(Dataset data)
Returns the minimum range value for the specified dataset.

This is easy if the dataset implements the 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:
The minimum range value in the dataset (or null if all the values in the dataset are null).

getMaximumRangeValue

public static java.lang.Number getMaximumRangeValue(Dataset data)
Returns the maximum range value for the specified dataset.

This is easy if the dataset implements the 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:
The maximum range value in the dataset (or null if all the values in the dataset are null).

createPieDataset

public static PieDataset createPieDataset(CategoryDataset data,
                                          java.lang.Object category)
Creates a pie dataset from a category dataset by taking all the values (across series) for a single category.

Parameters:
data - The data.
category - The category.

createPieDataset

public static PieDataset createPieDataset(CategoryDataset data,
                                          int series)
Creates a pie dataset from a category dataset by taking all the values for a single series.

Parameters:
data - The data.
series - The series (zero-based index).

getStackedRangeExtent

public static Range getStackedRangeExtent(CategoryDataset data)
Returns the range of values for the range (as in domain/range) of the dataset, assuming that the series in one category are stacked.

Parameters:
data - The dataset.

getMinimumStackedRangeValue

public static java.lang.Number getMinimumStackedRangeValue(CategoryDataset data)
Returns the minimum value in the dataset range, assuming that values in each category are "stacked".

Parameters:
data - The dataset.
Returns:
The minimum value.

getMaximumStackedRangeValue

public static java.lang.Number getMaximumStackedRangeValue(CategoryDataset data)
Returns the maximum value in the dataset range, assuming that values in each category are "stacked".

Parameters:
data - The dataset.
Returns:
The maximum value.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.