public class CategoryPieDataset
extends org.jfree.data.general.AbstractDataset
implements org.jfree.data.general.PieDataset, org.jfree.data.category.CategoryDataset, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
BY_COLUMN
Extact pie data by column
|
static int |
BY_ROW
Extact pie data by row
|
Constructor and Description |
---|
CategoryPieDataset()
Creates a new (empty) dataset.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(java.lang.Object element,
java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Adds an element to an existing list in the dataset and sends a
DatasetChangeEvent to all registered listeners.
|
void |
clear()
Clears all data from the dataset and sends a DatasetChangeEvent} to all
registered listeners.
|
int |
getColumnCount()
Returns the number of columns in the table.
|
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.
|
int |
getExtractMode() |
int |
getIndex(java.lang.Comparable key)
Returns the index for a key in the pie dataset, or -1 if the key is not
recognised.
|
int |
getItemCount()
Returns the number of items in the pie dataset.
|
java.lang.Comparable |
getKey(int item)
Returns the key for the specified item in the pie dataset, or
null . |
java.util.List |
getKeys()
Returns the categories in the pie dataset.
|
java.util.List |
getList(java.lang.Comparable key)
Returns the list of all pie elements.
|
java.util.List |
getList(java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Retrun the list for a given row and column key.
|
java.util.List |
getList(java.lang.Comparable key,
int pieindex)
Returns the list of elements from a specific pieindex.
|
int |
getRowCount()
Returns the number of rows in the table.
|
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 key)
Returns the data value associated with a key.
|
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 item)
Returns a value for a specific item in the pie dataset.
|
java.lang.Number |
getValue(int row,
int column)
Returns a value from the table.
|
void |
removeColumn(java.lang.Comparable columnKey)
Removes a column from the dataset and sends a DatasetChangeEvent to all
registered listeners.
|
void |
removeColumn(int columnIndex)
Removes a column from the dataset and sends a DatasetChangeEvent to all
registered listeners.
|
void |
removeElement(java.lang.Object element,
java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Removes an element from an existing list in the dataset and sends a
DatasetChangeEvent to all registered listeners.
|
void |
removeRow(java.lang.Comparable rowKey)
Removes a row from the dataset and sends a DatasetChangeEvent to all
registered listeners.
|
void |
removeRow(int rowIndex)
Removes a row from the dataset and sends a DatasetChangeEvent to all
registered listeners.
|
void |
setExtractMode(int extractMode) |
void |
setList(java.util.List list,
java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Adds or updates a list in the table and sends a DatasetChangeEvent to all
registered listeners.
|
addChangeListener, clone, fireDatasetChanged, getGroup, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject
public static final int BY_ROW
public static final int BY_COLUMN
public void setList(java.util.List list, java.lang.Comparable rowKey, java.lang.Comparable columnKey)
list
- the list (null
permitted).rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).public void addElement(java.lang.Object element, java.lang.Comparable rowKey, java.lang.Comparable columnKey)
null
, a new list is created and the element is added.element
- The element.rowKey
- The row key (null
is converted to the
nullstring).columnKey
- The column key (null
is converted to the
nullstring)..public void removeElement(java.lang.Object element, java.lang.Comparable rowKey, java.lang.Comparable columnKey)
null
, a new list is created and the element is added.element
- The element.rowKey
- The row key (null
is converted to the
nullstring).columnKey
- The column key (null
is converted to the
nullstring)..public java.util.List getList(java.lang.Comparable rowKey, java.lang.Comparable columnKey)
rowKey
- The row key (null
is converted to the
nullstring).columnKey
- The column key (null
is converted to the
nullstring)..public void removeRow(int rowIndex)
rowIndex
- the row index.public void removeRow(java.lang.Comparable rowKey)
rowKey
- the row key.public void removeColumn(int columnIndex)
columnIndex
- the column index.public void removeColumn(java.lang.Comparable columnKey)
columnKey
- the column key.public void clear()
public int getRowCount()
getRowCount
in interface org.jfree.data.Values2D
public int getColumnCount()
getColumnCount
in interface org.jfree.data.Values2D
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.Comparable getRowKey(int row)
getRowKey
in interface org.jfree.data.KeyedValues2D
row
- the row index (zero-based).public int getRowIndex(java.lang.Comparable key)
getRowIndex
in interface org.jfree.data.KeyedValues2D
key
- the row key.public java.util.List getRowKeys()
getRowKeys
in interface org.jfree.data.KeyedValues2D
public java.lang.Comparable getColumnKey(int column)
getColumnKey
in interface org.jfree.data.KeyedValues2D
column
- the column index (zero-based).public int getColumnIndex(java.lang.Comparable key)
getColumnIndex
in interface org.jfree.data.KeyedValues2D
key
- the column key.public java.util.List getColumnKeys()
getColumnKeys
in interface org.jfree.data.KeyedValues2D
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 int getExtractMode()
public void setExtractMode(int extractMode)
extractMode
- the extract mode to setpublic java.util.List getList(java.lang.Comparable key)
key
- The key (null
not permitted).null
).public java.util.List getList(java.lang.Comparable key, int pieindex)
key
- The key (null
not permitted).pieindex
- The pieindex.null
).public int getItemCount()
getItemCount
in interface org.jfree.data.Values
public java.lang.Number getValue(int item)
getValue
in interface org.jfree.data.Values
item
- The item index.null
).public int getIndex(java.lang.Comparable key)
getIndex
in interface org.jfree.data.KeyedValues
key
- the key (null
not permitted).-1
if the key is unrecognised.public java.lang.Comparable getKey(int item)
null
.getKey
in interface org.jfree.data.KeyedValues
item
- the item index (in the range 0
to
getItemCount() - 1
).null
.public java.util.List getKeys()
getKeys
in interface org.jfree.data.KeyedValues
public java.lang.Number getValue(java.lang.Comparable key)
getValue
in interface org.jfree.data.KeyedValues
key
- the key (null
not permitted).null
).