org.jfree.data.category

Class DefaultIntervalCategoryDataset

public class DefaultIntervalCategoryDataset extends AbstractSeriesDataset implements IntervalCategoryDataset

A convenience class that provides a default implementation of the IntervalCategoryDataset interface.

The standard constructor accepts data in a two dimensional array where the first dimension is the series, and the second dimension is the category.

Constructor Summary
DefaultIntervalCategoryDataset(double[][] starts, double[][] ends)
Creates a new dataset using the specified data values and automatically generated series and category keys.
DefaultIntervalCategoryDataset(Number[][] starts, Number[][] ends)
Constructs a dataset and populates it with data from the array.
DefaultIntervalCategoryDataset(String[] seriesNames, Number[][] starts, Number[][] ends)
Constructs a DefaultIntervalCategoryDataset, populates it with data from the arrays, and uses the supplied names for the series.
DefaultIntervalCategoryDataset(Comparable[] seriesKeys, Comparable[] categoryKeys, Number[][] starts, Number[][] ends)
Constructs a DefaultIntervalCategoryDataset, populates it with data from the arrays, and uses the supplied names for the series and the supplied objects for the categories.
Method Summary
Objectclone()
Returns a clone of this dataset.
booleanequals(Object obj)
Tests this dataset for equality with an arbitrary object.
ListgetCategories()
Returns a list of the categories in the dataset.
intgetCategoryCount()
Returns the number of categories in the dataset.
intgetCategoryIndex(Comparable category)
Returns the index for the given category.
intgetColumnCount()
Returns the number of categories in the dataset.
intgetColumnIndex(Comparable columnKey)
Returns a column index.
ComparablegetColumnKey(int column)
Returns a column key.
ListgetColumnKeys()
Returns a list of the categories in the dataset.
NumbergetEndValue(Comparable series, Comparable category)
Returns the end data value for one category in a series.
NumbergetEndValue(int series, int category)
Returns the end data value for one category in a series.
intgetItemCount()
Returns the item count.
intgetRowCount()
Returns the number of series in the dataset (possibly zero).
intgetRowIndex(Comparable rowKey)
Returns a row index.
ComparablegetRowKey(int row)
Returns the name of the specified series.
ListgetRowKeys()
Returns a list of the series in the dataset.
ListgetSeries()
Returns a list of the series in the dataset.
intgetSeriesCount()
Returns the number of series in the dataset (possibly zero).
intgetSeriesIndex(Comparable seriesKey)
Returns a series index.
ComparablegetSeriesKey(int series)
Returns the name of the specified series.
NumbergetStartValue(Comparable series, Comparable category)
Returns the start data value for one category in a series.
NumbergetStartValue(int series, int category)
Returns the start data value for one category in a series.
NumbergetValue(Comparable series, Comparable category)
Returns the data value for one category in a series.
NumbergetValue(int series, int category)
Returns the data value for one category in a series.
voidsetCategoryKeys(Comparable[] categoryKeys)
Sets the categories for the dataset.
voidsetEndValue(int series, Comparable category, Number value)
Sets the end data value for one category in a series.
voidsetSeriesKeys(Comparable[] seriesKeys)
Sets the names of the series in the dataset.
voidsetStartValue(int series, Comparable category, Number value)
Sets the start data value for one category in a series.

Constructor Detail

DefaultIntervalCategoryDataset

public DefaultIntervalCategoryDataset(double[][] starts, double[][] ends)
Creates a new dataset using the specified data values and automatically generated series and category keys.

Parameters: starts the starting values for the intervals (null not permitted). ends the ending values for the intervals (null not permitted).

DefaultIntervalCategoryDataset

public DefaultIntervalCategoryDataset(Number[][] starts, Number[][] ends)
Constructs a dataset and populates it with data from the array.

The arrays are indexed as data[series][category]. Series and category names are automatically generated - you can change them using the (Comparable[]) and (Comparable[]) methods.

Parameters: starts the start values data. ends the end values data.

DefaultIntervalCategoryDataset

public DefaultIntervalCategoryDataset(String[] seriesNames, Number[][] starts, Number[][] ends)
Constructs a DefaultIntervalCategoryDataset, populates it with data from the arrays, and uses the supplied names for the series.

Category names are generated automatically ("Category 1", "Category 2", etc).

Parameters: seriesNames the series names (if null, series names will be generated automatically). starts the start values data, indexed as data[series][category]. ends the end values data, indexed as data[series][category].

DefaultIntervalCategoryDataset

public DefaultIntervalCategoryDataset(Comparable[] seriesKeys, Comparable[] categoryKeys, Number[][] starts, Number[][] ends)
Constructs a DefaultIntervalCategoryDataset, populates it with data from the arrays, and uses the supplied names for the series and the supplied objects for the categories.

Parameters: seriesKeys the series keys (if null, series keys will be generated automatically). categoryKeys the category keys (if null, category keys will be generated automatically). starts the start values data, indexed as data[series][category]. ends the end values data, indexed as data[series][category].

Method Detail

clone

public Object clone()
Returns a clone of this dataset.

Returns: A clone.

Throws: CloneNotSupportedException if there is a problem cloning the dataset.

equals

public boolean equals(Object obj)
Tests this dataset for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getCategories

public List getCategories()

Deprecated: Use getColumnKeys instead.

Returns a list of the categories in the dataset.

Returns: A list of the categories in the dataset.

getCategoryCount

public int getCategoryCount()
Returns the number of categories in the dataset.

Returns: The number of categories in the dataset.

See Also: getColumnCount

getCategoryIndex

public int getCategoryIndex(Comparable category)
Returns the index for the given category.

Parameters: category the category (null not permitted).

Returns: The index.

See Also: getColumnIndex

getColumnCount

public int getColumnCount()
Returns the number of categories in the dataset. This method is part of the CategoryDataset interface.

Returns: The number of categories in the dataset.

See Also: getCategoryCount getRowCount

getColumnIndex

public int getColumnIndex(Comparable columnKey)
Returns a column index.

Parameters: columnKey the column key (null not permitted).

Returns: The column index.

See Also: getCategoryIndex

getColumnKey

public Comparable getColumnKey(int column)
Returns a column key.

Parameters: column the column index.

Returns: The column key.

See Also: DefaultIntervalCategoryDataset

getColumnKeys

public List getColumnKeys()
Returns a list of the categories in the dataset. This method supports the CategoryDataset interface.

Returns: A list of the categories in the dataset.

See Also: getRowKeys

getEndValue

public Number getEndValue(Comparable series, Comparable category)
Returns the end data value for one category in a series.

Parameters: series the required series. category the required category.

Returns: The end data value for one category in a series (null possible).

See Also: DefaultIntervalCategoryDataset

getEndValue

public Number getEndValue(int series, int category)
Returns the end data value for one category in a series.

Parameters: series the required series (zero based index). category the required category.

Returns: The end data value for one category in a series (null possible).

See Also: DefaultIntervalCategoryDataset

getItemCount

public int getItemCount()

Deprecated: Use getCategoryCount instead.

Returns the item count.

Returns: The item count.

getRowCount

public int getRowCount()
Returns the number of series in the dataset (possibly zero).

Returns: The number of series in the dataset.

See Also: getSeriesCount getColumnCount

getRowIndex

public int getRowIndex(Comparable rowKey)
Returns a row index.

Parameters: rowKey the row key.

Returns: The row index.

See Also: getSeriesIndex

getRowKey

public Comparable getRowKey(int row)
Returns the name of the specified series.

Parameters: row the index of the required row/series (zero-based).

Returns: The name of the specified series.

See Also: DefaultIntervalCategoryDataset

getRowKeys

public List getRowKeys()
Returns a list of the series in the dataset. This method supports the CategoryDataset interface.

Returns: A list of the series in the dataset.

See Also: getColumnKeys

getSeries

public List getSeries()

Deprecated: Use getRowKeys instead.

Returns a list of the series in the dataset.

Returns: A list of the series in the dataset.

getSeriesCount

public int getSeriesCount()
Returns the number of series in the dataset (possibly zero).

Returns: The number of series in the dataset.

See Also: getRowCount getCategoryCount

getSeriesIndex

public int getSeriesIndex(Comparable seriesKey)
Returns a series index.

Parameters: seriesKey the series key.

Returns: The series index.

See Also: getRowIndex DefaultIntervalCategoryDataset

getSeriesKey

public Comparable getSeriesKey(int series)
Returns the name of the specified series.

Parameters: series the index of the required series (zero-based).

Returns: The name of the specified series.

See Also: getSeriesIndex

getStartValue

public Number getStartValue(Comparable series, Comparable category)
Returns the start data value for one category in a series.

Parameters: series the required series. category the required category.

Returns: The start data value for one category in a series (possibly null).

See Also: DefaultIntervalCategoryDataset

getStartValue

public Number getStartValue(int series, int category)
Returns the start data value for one category in a series.

Parameters: series the required series (zero based index). category the required category.

Returns: The start data value for one category in a series (possibly null).

See Also: DefaultIntervalCategoryDataset

getValue

public Number getValue(Comparable series, Comparable category)
Returns the data value for one category in a series.

This method is part of the CategoryDataset interface. Not particularly meaningful for this class...returns the end value.

Parameters: series The required series (zero based index). category The required category.

Returns: The data value for one category in a series (null possible).

See Also: DefaultIntervalCategoryDataset

getValue

public Number getValue(int series, int category)
Returns the data value for one category in a series.

This method is part of the CategoryDataset interface. Not particularly meaningful for this class...returns the end value.

Parameters: series the required series (zero based index). category the required category.

Returns: The data value for one category in a series (null possible).

See Also: DefaultIntervalCategoryDataset

setCategoryKeys

public void setCategoryKeys(Comparable[] categoryKeys)
Sets the categories for the dataset.

Parameters: categoryKeys an array of objects representing the categories in the dataset.

See Also: getRowKeys (Comparable[])

setEndValue

public void setEndValue(int series, Comparable category, Number value)
Sets the end data value for one category in a series.

Parameters: series the series (zero-based index). category the category. value the value.

See Also: DefaultIntervalCategoryDataset

setSeriesKeys

public void setSeriesKeys(Comparable[] seriesKeys)
Sets the names of the series in the dataset.

Parameters: seriesKeys the new keys (null not permitted, the length of the array must match the number of series in the dataset).

See Also: (Comparable[])

setStartValue

public void setStartValue(int series, Comparable category, Number value)
Sets the start data value for one category in a series.

Parameters: series the series (zero-based index). category the category. value The value.

See Also: DefaultIntervalCategoryDataset