public class GroupedCategoryDataset
extends org.jfree.data.general.AbstractDataset
implements org.jfree.data.category.CategoryDataset, org.jfree.data.general.DatasetChangeListener, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected org.jfree.chart.axis.SubCategoryAxis |
axis
The category axis for groups
|
protected java.util.Map |
datasets
The datasets for the Group
|
protected java.util.Map |
keyToDataset
The map with group rowkeys and datasets for easy and fast access to the
original datasets
|
protected java.util.List |
keyToGroup
The list of assigned groups
|
protected org.jfree.data.KeyToGroupMap |
keytogroupmap
The map for assigning series to groups
|
protected java.util.Map |
keyToRowKey
The map with group rowkeys and original rowkeys for easy and fast access
to the original datasets
|
protected org.jfree.chart.renderer.category.GroupedStackedBarRenderer |
renderer
The bar renderer for groups.
|
Constructor and Description |
---|
GroupedCategoryDataset()
Creates an initial dataset.
|
GroupedCategoryDataset(org.jfree.chart.renderer.category.GroupedStackedBarRenderer renderer,
org.jfree.chart.axis.SubCategoryAxis axis)
Creates a dataset, that is linked to a GroupedStackedBarRenderer for
assigne the groupmaps and to the SubCategoryAxis to create subcategories.
|
GroupedCategoryDataset(org.jfree.chart.JFreeChart chart)
Creates a dataset and retrieves the GroupedStackedBarRenderer and the
SubCategoryAxis from the chart.
|
Modifier and Type | Method and Description |
---|---|
void |
addCategoryDataset(org.jfree.data.category.CategoryDataset dataset,
java.lang.String name)
Adds a dataset and (if the dataset is not empty) assigning groups for
each rowkey to the renderer and adding subcategories to the axis.
|
void |
cleanup()
Removes all references to assigned objects.
|
void |
datasetChanged(org.jfree.data.general.DatasetChangeEvent event)
A dataset has changed.
|
int |
getColumnCount()
Returns the total number of different columns in the datasets.
|
int |
getColumnIndex(java.lang.Comparable key)
Returns the column index for a given key.
|
java.lang.Comparable |
getColumnKey(int column)
Returns a column key.
|
java.util.List |
getColumnKeys()
Returns the column keys.
|
java.util.List |
getList(java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Returns the List for a given group rowkey and column key.
|
java.lang.Comparable |
getOriginalRowKey(java.lang.Comparable rowKey)
Returns the original rowkey from a group rowkey
|
int |
getRowCount()
Returns the total number of all rows in the datasets.
|
int |
getRowIndex(java.lang.Comparable key)
Returns the row index for a given key.
|
java.lang.Comparable |
getRowKey(int row)
Returns a row key.
|
java.util.List |
getRowKeys()
Returns the row keys.
|
java.lang.Number |
getValue(java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Returns the value for a pair of keys.
|
java.lang.Number |
getValue(int row,
int column)
Returns a value from the table.
|
addChangeListener, clone, fireDatasetChanged, getGroup, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject
protected java.util.Map datasets
protected org.jfree.chart.axis.SubCategoryAxis axis
protected org.jfree.chart.renderer.category.GroupedStackedBarRenderer renderer
protected org.jfree.data.KeyToGroupMap keytogroupmap
protected java.util.List keyToGroup
protected java.util.Map keyToRowKey
protected java.util.Map keyToDataset
public GroupedCategoryDataset()
public GroupedCategoryDataset(org.jfree.chart.renderer.category.GroupedStackedBarRenderer renderer, org.jfree.chart.axis.SubCategoryAxis axis)
renderer
- The GroupedStackedBarRenderer.axis
- The SubCategoryAxis.public GroupedCategoryDataset(org.jfree.chart.JFreeChart chart)
chart
- public void addCategoryDataset(org.jfree.data.category.CategoryDataset dataset, java.lang.String name)
dataset
- The dataset.name
- The name for the dataset.public void cleanup()
public int getRowCount()
getRowCount
in interface org.jfree.data.Values2D
public int getColumnCount()
getColumnCount
in interface org.jfree.data.Values2D
public java.util.List getColumnKeys()
getColumnKeys
in interface org.jfree.data.KeyedValues2D
public java.util.List getRowKeys()
getRowKeys
in interface org.jfree.data.KeyedValues2D
public int getRowIndex(java.lang.Comparable key)
getRowIndex
in interface org.jfree.data.KeyedValues2D
key
- the row keys.public int getColumnIndex(java.lang.Comparable key)
getColumnIndex
in interface org.jfree.data.KeyedValues2D
key
- the column key.public java.lang.Comparable getRowKey(int row)
getRowKey
in interface org.jfree.data.KeyedValues2D
row
- the row index (zero-based).public java.lang.Comparable getColumnKey(int column)
getColumnKey
in interface org.jfree.data.KeyedValues2D
column
- the column index (zero-based).public java.lang.Number getValue(int row, int column)
getValue
in interface org.jfree.data.Values2D
row
- the row index (zero-based).column
- the column index (zero-based).null
).public java.lang.Number getValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
getValue
in interface org.jfree.data.KeyedValues2D
rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).null
).public void datasetChanged(org.jfree.data.general.DatasetChangeEvent event)
datasetChanged
in interface org.jfree.data.general.DatasetChangeListener
event
- The event.public java.util.List getList(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
rowKey
- The group rowkey.columnKey
- The columnkey.public java.lang.Comparable getOriginalRowKey(java.lang.Comparable rowKey)