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 List
getCategories()
Returns a list of the categories in the dataset.Comparable
getCategory(int item)
Returns a category key.int
getCategoryCount()
Returns the number of categories in the dataset.int
getColumnCount()
Returns the number of categories in the dataset.int
getColumnIndex(Comparable columnKey)
Returns a column index.Comparable
getColumnKey(int item)
Returns a column key.List
getColumnKeys()
Returns a list of the categories in the dataset.Number
getEndValue(int series, int category)
Returns the end data value for one category in a series.Number
getEndValue(Comparable series, Comparable category)
Returns the end data value for one category in a series.int
getItem(Object category)
Returns an item.int
getItemCount()
Returns the item count.int
getRowCount()
Returns the number of series in the dataset (possibly zero).int
getRowIndex(Comparable rowKey)
Returns a row index.Comparable
getRowKey(int series)
Returns the name of the specified series.List
getRowKeys()
Returns a list of the series in the dataset.List
getSeries()
Returns a list of the series in the dataset.Comparable
getSeries(int series)
Returns the name of the specified series.int
getSeriesCount()
Returns the number of series in the dataset (possibly zero).int
getSeriesIndex(Object series)
Returns a series index.String
getSeriesName(int series)
Returns the name of the specified series.Number
getStartValue(int series, int category)
Returns the start data value for one category in a series.Number
getStartValue(Comparable series, Comparable category)
Returns the start data value for one category in a series.Number
getValue(int series, int category)
Returns the data value for one category in a series.Number
getValue(Comparable series, Comparable category)
Returns the data value for one category in a series.void
setCategoryKeys(Comparable[] categoryKeys)
Sets the categories for the dataset.void
setEndValue(int series, Object category, Number value)
Sets the end data value for one category in a series.void
setSeriesKeys(Comparable[] seriesKeys)
Sets the names of the series in the dataset.void
setStartValue(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
seriesChanged
Methods inherited from class org.jfree.data.AbstractDataset
addChangeListener, clone, getGroup, removeChangeListener, setGroup, validateObject
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getSeriesCount
in interfaceSeriesDataset
- Specified by:
getSeriesCount
in 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:
getSeriesName
in interfaceSeriesDataset
- Specified by:
getSeriesName
in 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:
getColumnKeys
in 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:
getValue
in 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:
getStartValue
in 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:
getStartValue
in 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:
getEndValue
in 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:
getEndValue
in 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:
getColumnKey
in interfaceKeyedValues2D
- Parameters:
item
- the column index.- Returns:
- The column key.
-
getColumnIndex
Returns a column index.- Specified by:
getColumnIndex
in interfaceKeyedValues2D
- Parameters:
columnKey
- the column key.- Returns:
- The column index.
-
getRowIndex
Returns a row index.- Specified by:
getRowIndex
in 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:
getRowKeys
in interfaceKeyedValues2D
- Returns:
- a list of the series in the dataset.
-
getRowKey
Returns the name of the specified series.- Specified by:
getRowKey
in 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:
getColumnCount
in 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:
getRowCount
in interfaceValues2D
- Returns:
- the number of series in the dataset.
-