Class DefaultIntervalCategoryDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,CategoryDataset,Dataset,IntervalCategoryDataset,KeyedValues2D,SeriesChangeListener,SeriesDataset,Values2D
public class DefaultIntervalCategoryDataset extends AbstractSeriesDataset implements IntervalCategoryDataset
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.
- Author:
- Jeremy Bowman
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description DefaultIntervalCategoryDataset(double[][] starts, double[][] ends)Creates a new dataset.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 Type Method Description ListgetCategories()Returns a list of the categories in the dataset.ComparablegetCategory(int item)Returns a category key.intgetCategoryCount()Returns the number of categories in the dataset.intgetColumnCount()Returns the number of categories in the dataset.intgetColumnIndex(Comparable columnKey)Returns a column index.ComparablegetColumnKey(int item)Returns a column key.ListgetColumnKeys()Returns a list of the categories in the dataset.NumbergetEndValue(int series, int category)Returns the end data value for one category in a series.NumbergetEndValue(Comparable series, Comparable category)Returns the end data value for one category in a series.intgetItem(Object category)Returns an item.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 series)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.ComparablegetSeries(int series)Returns the name of the specified series.intgetSeriesCount()Returns the number of series in the dataset (possibly zero).intgetSeriesIndex(Object series)Returns a series index.StringgetSeriesName(int series)Returns the name of the specified series.NumbergetStartValue(int series, int category)Returns the start data value for one category in a series.NumbergetStartValue(Comparable series, Comparable category)Returns the start data value for one category in a series.NumbergetValue(int series, int category)Returns the data value for one category in a series.NumbergetValue(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, Object 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, Object category, Number value)Sets the start data value for one category in a series.Methods inherited from class org.jfree.data.AbstractSeriesDataset
seriesChangedMethods inherited from class org.jfree.data.AbstractDataset
addChangeListener, clone, getGroup, removeChangeListener, setGroup, validateObjectMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
DefaultIntervalCategoryDataset
public DefaultIntervalCategoryDataset(double[][] starts, double[][] ends)Creates a new dataset.- Parameters:
starts- the starting values for the intervals.ends- the ending values for the intervals.
-
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 setSeriesName(...) and setCategory(...) 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.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.categoryKeys- the categories.starts- the start values data, indexed as data[series][category].ends- the end values data, indexed as data[series][category].
-
-
Method Details
-
getSeriesCount
public int 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.
-
getItemCount
public int getItemCount()Returns the item count.- Returns:
- The item count.
-
getCategory
Returns a category key.- Parameters:
item- the category index.- Returns:
- The category key.
-
getItem
Returns an item.- Parameters:
category- the category key.- Returns:
- The item index.
-
getSeriesIndex
Returns a series index.- Parameters:
series- the series.- Returns:
- The series index.
-
getSeries
Returns the name of the specified series.- Parameters:
series- the index of the required series (zero-based).- Returns:
- the name of the specified series.
-
getSeriesName
Returns the name of the specified series.- Specified by:
getSeriesNamein interfaceSeriesDataset- Specified by:
getSeriesNamein classAbstractSeriesDataset- Parameters:
series- The index of the required series (zero-based).- Returns:
- the name of the specified series.
-
setSeriesKeys
Sets the names of the series in the dataset.- Parameters:
seriesKeys- the keys of the series in the dataset.
-
getCategoryCount
public int getCategoryCount()Returns the number of categories in the dataset.This method is part of the CategoryDataset interface.
- Returns:
- the number of categories in the dataset.
-
getSeries
Returns a list of the series in the dataset.Supports the CategoryDataset interface.
- Returns:
- a list of the series in the dataset.
-
getCategories
Returns a list of the categories in the dataset.Supports the CategoryDataset interface.
- Returns:
- a list of the categories in the dataset.
-
getColumnKeys
Returns a list of the categories in the dataset.Supports the CategoryDataset interface.
- Specified by:
getColumnKeysin interfaceKeyedValues2D- Returns:
- a list of the categories in the dataset.
-
setCategoryKeys
Sets the categories for the dataset.- Parameters:
categoryKeys- An array of objects representing the categories in the dataset.
-
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).
-
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.This method is part of the IntervalTableDataset interface.
- Specified by:
getStartValuein interfaceIntervalCategoryDataset- Parameters:
series- The required series.category- The required category.- Returns:
- The start data value for one category in a series (null possible).
-
getStartValue
Returns the start data value for one category in a series.This method is part of the IntervalTableDataset interface.
- 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 (null possible).
-
getEndValue
Returns the end data value for one category in a series.This method is part of the IntervalTableDataset interface.
- 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).
-
getEndValue
Returns the end data value for one category in a series.This method is part of the IntervalTableDataset interface.
- 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).
-
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.
-
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.
-
getColumnKey
Returns a column key.- Specified by:
getColumnKeyin interfaceKeyedValues2D- Parameters:
item- the column index.- Returns:
- The column key.
-
getColumnIndex
Returns a column index.- Specified by:
getColumnIndexin interfaceKeyedValues2D- Parameters:
columnKey- the column key.- Returns:
- The column index.
-
getRowIndex
Returns a row index.- Specified by:
getRowIndexin interfaceKeyedValues2D- Parameters:
rowKey- the row key.- Returns:
- The row index.
-
getRowKeys
Returns a list of the series in the dataset.Supports the CategoryDataset interface.
- Specified by:
getRowKeysin interfaceKeyedValues2D- Returns:
- a list of the series in the dataset.
-
getRowKey
Returns the name of the specified series.- Specified by:
getRowKeyin interfaceKeyedValues2D- Parameters:
series- the index of the required series (zero-based).- Returns:
- the name of the specified series.
-
getColumnCount
public int getColumnCount()Returns the number of categories in the dataset.This method is part of the CategoryDataset interface.
- Specified by:
getColumnCountin interfaceValues2D- Returns:
- the number of categories in the dataset.
-
getRowCount
public int getRowCount()Returns the number of series in the dataset (possibly zero).- Specified by:
getRowCountin interfaceValues2D- Returns:
- the number of series in the dataset.
-