|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.data.AbstractDataset | +--com.jrefinery.data.AbstractSeriesDataset | +--com.jrefinery.data.DefaultCategoryDataset
A convenience class that provides a default implementation of the CategoryDataset 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.
Field Summary | |
protected java.lang.Object[] |
categories
The categories. |
protected java.lang.Number[][] |
data
Storage for the data. |
protected java.lang.String[] |
seriesNames
The series names. |
Constructor Summary | |
DefaultCategoryDataset(double[][] data)
Creates a new category dataset. |
|
DefaultCategoryDataset(java.lang.Number[][] data)
Constructs a dataset and populates it with data from the array. |
|
DefaultCategoryDataset(java.lang.String[] seriesNames,
java.lang.Number[][] data)
Constructs a DefaultCategoryDataset, populates it with data from the array, and uses the supplied names for the series. |
|
DefaultCategoryDataset(java.lang.String[] seriesNames,
java.lang.Object[] categories,
java.lang.Number[][] data)
Constructs a DefaultCategoryDataset, populates it with data from the array, and uses the supplied names for the series and the supplied objects for the categories. |
Method Summary | |
java.util.List |
getCategories()
Returns a list of the categories in the dataset. |
int |
getCategoryCount()
Returns the number of categories in the dataset. |
int |
getSeriesCount()
Returns the number of series in the dataset (possibly zero). |
java.lang.String |
getSeriesName(int series)
Returns the name of the specified series. |
java.lang.Number |
getValue(int series,
java.lang.Object category)
Returns the data value for one category in a series. |
void |
setCategories(java.lang.Object[] categories)
Sets the categories for the dataset. |
void |
setSeriesName(int series,
java.lang.String name)
Sets the name of a series. |
void |
setSeriesNames(java.lang.String[] seriesNames)
Sets the names of all the series in the dataset. |
void |
setValue(int series,
java.lang.Object category,
java.lang.Number value)
Sets the data value for one category in a series. |
Methods inherited from class com.jrefinery.data.AbstractSeriesDataset |
getLegendItemCount, getLegendItemLabels, seriesChanged |
Methods inherited from class com.jrefinery.data.AbstractDataset |
addChangeListener, fireDatasetChanged, getGroup, notifyListeners, removeChangeListener, setGroup |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jrefinery.data.Dataset |
addChangeListener, getGroup, removeChangeListener, setGroup |
Field Detail |
protected java.lang.String[] seriesNames
protected java.lang.Object[] categories
protected java.lang.Number[][] data
Constructor Detail |
public DefaultCategoryDataset(double[][] data)
The array is indexed as data[series][category]. Series and category names are automatically generated, but you can change them using the setSeriesName(...) and setCategory(...) methods.
data
- the data.public DefaultCategoryDataset(java.lang.Number[][] data)
The array is indexed as data[series][category]. Series and category names are automatically generated, but you can change them using the setSeriesName(...) and setCategory(...) methods.
data
- The data.public DefaultCategoryDataset(java.lang.String[] seriesNames, java.lang.Number[][] data)
Category names are generated automatically ("Category 1", "Category 2", etc).
seriesNames
- the series names.data
- the data, indexed as data[series][category].public DefaultCategoryDataset(java.lang.String[] seriesNames, java.lang.Object[] categories, java.lang.Number[][] data)
seriesNames
- the series names.categories
- the categories.data
- the data, indexed as data[series][category].Method Detail |
public int getSeriesCount()
getSeriesCount
in interface SeriesDataset
getSeriesCount
in class AbstractSeriesDataset
public java.lang.String getSeriesName(int series)
getSeriesName
in interface SeriesDataset
getSeriesName
in class AbstractSeriesDataset
series
- the index of the required series (zero-based).public void setSeriesName(int series, java.lang.String name)
series
- the series (zero-based index).name
- the series name.public void setSeriesNames(java.lang.String[] seriesNames)
seriesNames
- the series names.public int getCategoryCount()
This method is part of the CategoryDataset interface.
getCategoryCount
in interface CategoryDataset
public java.util.List getCategories()
Supports the CategoryDataset interface.
getCategories
in interface CategoryDataset
public void setCategories(java.lang.Object[] categories)
categories
- an array of objects representing the categories in the dataset.public java.lang.Number getValue(int series, java.lang.Object category)
This method is part of the CategoryDataset interface.
getValue
in interface CategoryDataset
series
- the required series (zero based index).category
- the required category.public void setValue(int series, java.lang.Object category, java.lang.Number value)
series
- the series (zero-based index).category
- the category.value
- the value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |