Package jadex.tools.comanalyzer.chart
Class CategoryPieDataset
- java.lang.Object
- 
- org.jfree.data.general.AbstractDataset
- 
- jadex.tools.comanalyzer.chart.CategoryPieDataset
 
 
- 
- All Implemented Interfaces:
- java.io.ObjectInputValidation,- java.io.Serializable,- java.lang.Cloneable,- org.jfree.data.category.CategoryDataset,- org.jfree.data.general.Dataset,- org.jfree.data.general.PieDataset,- org.jfree.data.KeyedValues,- org.jfree.data.KeyedValues2D,- org.jfree.data.Values,- org.jfree.data.Values2D
 
 public class CategoryPieDataset extends org.jfree.data.general.AbstractDataset implements org.jfree.data.general.PieDataset, org.jfree.data.category.CategoryDataset, java.io.SerializableA dataset that implements both PieDataset and CategoryDataset and can be used for both types of charts. The dataset contains Lists rather than values. For the interfaces getValue() retrieves the size of the list for a specific row and column index- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description CategoryPieDataset()Creates a new (empty) dataset.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddElement(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.voidclear()Clears all data from the dataset and sends a DatasetChangeEvent} to all registered listeners.intgetColumnCount()Returns the number of columns in the table.intgetColumnIndex(java.lang.Comparable key)Returns the column index for a given key.java.lang.ComparablegetColumnKey(int column)Returns a column key.java.util.ListgetColumnKeys()Returns the column keys.intgetExtractMode()intgetIndex(java.lang.Comparable key)Returns the index for a key in the pie dataset, or -1 if the key is not recognised.intgetItemCount()Returns the number of items in the pie dataset.java.lang.ComparablegetKey(int item)Returns the key for the specified item in the pie dataset, ornull.java.util.ListgetKeys()Returns the categories in the pie dataset.java.util.ListgetList(java.lang.Comparable key)Returns the list of all pie elements.java.util.ListgetList(java.lang.Comparable key, int pieindex)Returns the list of elements from a specific pieindex.java.util.ListgetList(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Retrun the list for a given row and column key.intgetRowCount()Returns the number of rows in the table.intgetRowIndex(java.lang.Comparable key)Returns the row index for a given key.java.lang.ComparablegetRowKey(int row)Returns a row key.java.util.ListgetRowKeys()Returns the row keys.java.lang.NumbergetValue(int item)Returns a value for a specific item in the pie dataset.java.lang.NumbergetValue(int row, int column)Returns a value from the table.java.lang.NumbergetValue(java.lang.Comparable key)Returns the data value associated with a key.java.lang.NumbergetValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the value for a pair of keys.voidremoveColumn(int columnIndex)Removes a column from the dataset and sends a DatasetChangeEvent to all registered listeners.voidremoveColumn(java.lang.Comparable columnKey)Removes a column from the dataset and sends a DatasetChangeEvent to all registered listeners.voidremoveElement(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.voidremoveRow(int rowIndex)Removes a row from the dataset and sends a DatasetChangeEvent to all registered listeners.voidremoveRow(java.lang.Comparable rowKey)Removes a row from the dataset and sends a DatasetChangeEvent to all registered listeners.voidsetExtractMode(int extractMode)voidsetList(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.- 
Methods inherited from class org.jfree.data.general.AbstractDatasetaddChangeListener, clone, fireDatasetChanged, getGroup, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject
 
- 
 
- 
- 
- 
Field Detail- 
BY_ROWpublic static final int BY_ROW Extact pie data by row- See Also:
- Constant Field Values
 
 - 
BY_COLUMNpublic static final int BY_COLUMN Extact pie data by column- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
setListpublic 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.- Parameters:
- list- the list (- nullpermitted).
- rowKey- the row key (- nullnot permitted).
- columnKey- the column key (- nullnot permitted).
 
 - 
addElementpublic 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. If the existing list isnull, a new list is created and the element is added.- Parameters:
- element- The element.
- rowKey- The row key (- nullis converted to the nullstring).
- columnKey- The column key (- nullis converted to the nullstring)..
 
 - 
removeElementpublic 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. If the existing list isnull, a new list is created and the element is added.- Parameters:
- element- The element.
- rowKey- The row key (- nullis converted to the nullstring).
- columnKey- The column key (- nullis converted to the nullstring)..
 
 - 
getListpublic java.util.List getList(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Retrun the list for a given row and column key.- Parameters:
- rowKey- The row key (- nullis converted to the nullstring).
- columnKey- The column key (- nullis converted to the nullstring)..
- Returns:
- The list.
 
 - 
removeRowpublic void removeRow(int rowIndex) Removes a row from the dataset and sends a DatasetChangeEvent to all registered listeners.- Parameters:
- rowIndex- the row index.
 
 - 
removeRowpublic void removeRow(java.lang.Comparable rowKey) Removes a row from the dataset and sends a DatasetChangeEvent to all registered listeners.- Parameters:
- rowKey- the row key.
 
 - 
removeColumnpublic void removeColumn(int columnIndex) Removes a column from the dataset and sends a DatasetChangeEvent to all registered listeners.- Parameters:
- columnIndex- the column index.
 
 - 
removeColumnpublic void removeColumn(java.lang.Comparable columnKey) Removes a column from the dataset and sends a DatasetChangeEvent to all registered listeners.- Parameters:
- columnKey- the column key.
 
 - 
clearpublic void clear() Clears all data from the dataset and sends a DatasetChangeEvent} to all registered listeners.
 - 
getRowCountpublic int getRowCount() Returns the number of rows in the table.- Specified by:
- getRowCountin interface- org.jfree.data.Values2D
- Returns:
- The row count.
 
 - 
getColumnCountpublic int getColumnCount() Returns the number of columns in the table.- Specified by:
- getColumnCountin interface- org.jfree.data.Values2D
- Returns:
- The column count.
 
 - 
getValuepublic java.lang.Number getValue(int row, int column)Returns a value from the table.- Specified by:
- getValuein interface- org.jfree.data.Values2D
- Parameters:
- row- the row index (zero-based).
- column- the column index (zero-based).
- Returns:
- The value (possibly null).
 
 - 
getRowKeypublic java.lang.Comparable getRowKey(int row) Returns a row key.- Specified by:
- getRowKeyin interface- org.jfree.data.KeyedValues2D
- Parameters:
- row- the row index (zero-based).
- Returns:
- The row key.
 
 - 
getRowIndexpublic int getRowIndex(java.lang.Comparable key) Returns the row index for a given key.- Specified by:
- getRowIndexin interface- org.jfree.data.KeyedValues2D
- Parameters:
- key- the row key.
- Returns:
- The row index.
 
 - 
getRowKeyspublic java.util.List getRowKeys() Returns the row keys.- Specified by:
- getRowKeysin interface- org.jfree.data.KeyedValues2D
- Returns:
- The keys.
 
 - 
getColumnKeypublic java.lang.Comparable getColumnKey(int column) Returns a column key.- Specified by:
- getColumnKeyin interface- org.jfree.data.KeyedValues2D
- Parameters:
- column- the column index (zero-based).
- Returns:
- The column key.
 
 - 
getColumnIndexpublic int getColumnIndex(java.lang.Comparable key) Returns the column index for a given key.- Specified by:
- getColumnIndexin interface- org.jfree.data.KeyedValues2D
- Parameters:
- key- the column key.
- Returns:
- The column index.
 
 - 
getColumnKeyspublic java.util.List getColumnKeys() Returns the column keys.- Specified by:
- getColumnKeysin interface- org.jfree.data.KeyedValues2D
- Returns:
- The keys.
 
 - 
getValuepublic java.lang.Number getValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the value for a pair of keys.- Specified by:
- getValuein interface- org.jfree.data.KeyedValues2D
- Parameters:
- rowKey- the row key (- nullnot permitted).
- columnKey- the column key (- nullnot permitted).
- Returns:
- The value (possibly null).
 
 - 
getExtractModepublic int getExtractMode() - Returns:
- the extract mode for pie data
 
 - 
setExtractModepublic void setExtractMode(int extractMode) - Parameters:
- extractMode- the extract mode to set
 
 - 
getListpublic java.util.List getList(java.lang.Comparable key) Returns the list of all pie elements.- Parameters:
- key- The key (- nullnot permitted).
- Returns:
- The list (possibly null).
 
 - 
getListpublic java.util.List getList(java.lang.Comparable key, int pieindex)Returns the list of elements from a specific pieindex.- Parameters:
- key- The key (- nullnot permitted).
- pieindex- The pieindex.
- Returns:
- The list (possibly null).
 
 - 
getItemCountpublic int getItemCount() Returns the number of items in the pie dataset.- Specified by:
- getItemCountin interface- org.jfree.data.Values
- Returns:
- The item count.
 
 - 
getValuepublic java.lang.Number getValue(int item) Returns a value for a specific item in the pie dataset.- Specified by:
- getValuein interface- org.jfree.data.Values
- Parameters:
- item- The item index.
- Returns:
- The value (possibly null).
 
 - 
getIndexpublic int getIndex(java.lang.Comparable key) Returns the index for a key in the pie dataset, or -1 if the key is not recognised.- Specified by:
- getIndexin interface- org.jfree.data.KeyedValues
- Parameters:
- key- the key (- nullnot permitted).
- Returns:
- The index, or -1if the key is unrecognised.
 
 - 
getKeypublic java.lang.Comparable getKey(int item) Returns the key for the specified item in the pie dataset, ornull.- Specified by:
- getKeyin interface- org.jfree.data.KeyedValues
- Parameters:
- item- the item index (in the range- 0to- getItemCount() - 1).
- Returns:
- The key, or null.
 
 - 
getKeyspublic java.util.List getKeys() Returns the categories in the pie dataset. The returned list is unmodifiable.- Specified by:
- getKeysin interface- org.jfree.data.KeyedValues
- Returns:
- The categories in the dataset.
 
 - 
getValuepublic java.lang.Number getValue(java.lang.Comparable key) Returns the data value associated with a key.- Specified by:
- getValuein interface- org.jfree.data.KeyedValues
- Parameters:
- key- the key (- nullnot permitted).
- Returns:
- The value (possibly null).
 
 
- 
 
-