Package org.jfree.data.category
Class DefaultIntervalCategoryDataset
java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.AbstractSeriesDataset
org.jfree.data.category.DefaultIntervalCategoryDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,CategoryDataset,IntervalCategoryDataset,Dataset,SeriesChangeListener,SeriesDataset,KeyedValues2D,Values2D
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.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultIntervalCategoryDataset(double[][] starts, double[][] ends) Creates a new dataset using the specified data values and automatically generated series and category keys.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.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. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a clone of this dataset.booleanTests this dataset for equality with an arbitrary object.intReturns the number of categories in the dataset.intgetCategoryIndex(Comparable category) Returns the index for the given category.intReturns the number of categories in the dataset.intgetColumnIndex(Comparable columnKey) Returns a column index.getColumnKey(int column) Returns a column key.Returns a list of the categories in the dataset.getEndValue(int series, int category) Returns the end data value for one category in a series.getEndValue(Comparable series, Comparable category) Returns the end data value for one category in a series.intReturns the number of series in the dataset (possibly zero).intgetRowIndex(Comparable rowKey) Returns a row index.getRowKey(int row) Returns the name of the specified series.Returns a list of the series in the dataset.intReturns the number of series in the dataset (possibly zero).intgetSeriesIndex(Comparable seriesKey) Returns a series index.getSeriesKey(int series) Returns the name of the specified series.getStartValue(int series, int category) Returns the start data value for one category in a series.getStartValue(Comparable series, Comparable category) Returns the start data value for one category in a series.getValue(int series, int category) Returns the data value for one category in a series.getValue(Comparable series, Comparable 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.Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChangedMethods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, canEqual, fireDatasetChanged, getGroup, getNotify, hashCode, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
DefaultIntervalCategoryDataset
Creates a new dataset using the specified data values and automatically generated series and category keys.- Parameters:
starts- the starting values for the intervals (nullnot permitted).ends- the ending values for the intervals (nullnot permitted).
-
DefaultIntervalCategoryDataset
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
setSeriesKeys(Comparable[])andsetCategoryKeys(Comparable[])methods.- Parameters:
starts- the start values data.ends- the end values data.
-
DefaultIntervalCategoryDataset
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 (ifnull, 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 (ifnull, series keys will be generated automatically).categoryKeys- the category keys (ifnull, 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 Details
-
getSeriesCount
Returns the number of series in the dataset (possibly zero).- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- The number of series in the dataset.
- See Also:
-
getSeriesIndex
Returns a series index.- Parameters:
seriesKey- the series key.- Returns:
- The series index.
- See Also:
-
getSeriesKey
Returns the name of the specified series.- Specified by:
getSeriesKeyin interfaceSeriesDataset- Specified by:
getSeriesKeyin classAbstractSeriesDataset- Parameters:
series- the index of the required series (zero-based).- Returns:
- The name of the specified series.
- See Also:
-
setSeriesKeys
Sets the names of the series in the dataset.- Parameters:
seriesKeys- the new keys (nullnot permitted, the length of the array must match the number of series in the dataset).- See Also:
-
getCategoryCount
Returns the number of categories in the dataset.- Returns:
- The number of categories in the dataset.
- See Also:
-
getColumnKeys
Returns a list of the categories in the dataset. This method supports theCategoryDatasetinterface.- Specified by:
getColumnKeysin interfaceKeyedValues2D- Returns:
- A list of the categories in the dataset.
- See Also:
-
setCategoryKeys
Sets the categories for the dataset.- Parameters:
categoryKeys- an array of objects representing the categories in the dataset.- See Also:
-
getValue
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.
- Specified by:
getValuein interfaceKeyedValues2D- 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:
-
getValue
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.
-
getStartValue
Returns the start data value for one category in a series.- Specified by:
getStartValuein interfaceIntervalCategoryDataset- Parameters:
series- the required series.category- the required category.- Returns:
- The start data value for one category in a series
(possibly
null). - See Also:
-
getStartValue
Returns the start data value for one category in a series.- Specified by:
getStartValuein interfaceIntervalCategoryDataset- 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:
-
getEndValue
Returns the end data value for one category in a series.- Specified by:
getEndValuein interfaceIntervalCategoryDataset- Parameters:
series- the required series.category- the required category.- Returns:
- The end data value for one category in a series (null possible).
- See Also:
-
getEndValue
Returns the end data value for one category in a series.- Specified by:
getEndValuein interfaceIntervalCategoryDataset- 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:
-
setStartValue
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:
-
setEndValue
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:
-
getCategoryIndex
Returns the index for the given category.- Parameters:
category- the category (nullnot permitted).- Returns:
- The index.
- See Also:
-
getColumnKey
Returns a column key.- Specified by:
getColumnKeyin interfaceKeyedValues2D- Parameters:
column- the column index.- Returns:
- The column key.
- See Also:
-
getColumnIndex
Returns a column index.- Specified by:
getColumnIndexin interfaceKeyedValues2D- Parameters:
columnKey- the column key (nullnot permitted).- Returns:
- The column index.
- See Also:
-
getRowIndex
Returns a row index.- Specified by:
getRowIndexin interfaceKeyedValues2D- Parameters:
rowKey- the row key.- Returns:
- The row index.
- See Also:
-
getRowKeys
Returns a list of the series in the dataset. This method supports theCategoryDatasetinterface.- Specified by:
getRowKeysin interfaceKeyedValues2D- Returns:
- A list of the series in the dataset.
- See Also:
-
getRowKey
Returns the name of the specified series.- Specified by:
getRowKeyin interfaceKeyedValues2D- Parameters:
row- the index of the required row/series (zero-based).- Returns:
- The name of the specified series.
- See Also:
-
getColumnCount
Returns the number of categories in the dataset. This method is part of theCategoryDatasetinterface.- Specified by:
getColumnCountin interfaceValues2D- Returns:
- The number of categories in the dataset.
- See Also:
-
getRowCount
Returns the number of series in the dataset (possibly zero).- Specified by:
getRowCountin interfaceValues2D- Returns:
- The number of series in the dataset.
- See Also:
-
equals
Tests this dataset for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
Returns a clone of this dataset.- Overrides:
clonein classAbstractDataset- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if there is a problem cloning the dataset.
-