Package org.jfree.data
Class CategoryToPieDataset
java.lang.Object
org.jfree.data.AbstractDataset
org.jfree.data.CategoryToPieDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,Dataset,DatasetChangeListener,KeyedValues,PieDataset,Values
public class CategoryToPieDataset extends AbstractDataset implements PieDataset, DatasetChangeListener
A
PieDataset implementation that obtains its data from one row or
column of a CategoryDataset.- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CategoryToPieDataset(CategoryDataset source, int extract, int index)Deprecated.Use the other constructor.CategoryToPieDataset(CategoryDataset source, org.jfree.util.TableOrder extract, int index)An adaptor class that converts anyCategoryDatasetinto aPieDataset, by taking the values from a single row or column. -
Method Summary
Modifier and Type Method Description voiddatasetChanged(DatasetChangeEvent event)Passes theDatasetChangeEventthrough.intgetIndex(Comparable key)Returns the index for a given key.intgetItemCount()Returns the number of items (values) in the collection.ComparablegetKey(int index)Returns a key.ListgetKeys()Returns the keys.NumbergetValue(int item)Returns a value.NumbergetValue(Comparable key)Returns the value for a given key.Methods inherited from class org.jfree.data.AbstractDataset
addChangeListener, clone, getGroup, removeChangeListener, setGroup, validateObjectMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Field Details
-
ROW
public static final int ROWDeprecated.Use the TableOrder class.A constant indicating that data should be extracted from a row.- See Also:
- Constant Field Values
-
COLUMN
public static final int COLUMNDeprecated.Use the TableOrder class.A constant indicating that data should be extracted from a column.- See Also:
- Constant Field Values
-
-
Constructor Details
-
CategoryToPieDataset
An adaptor class that converts anyCategoryDatasetinto aPieDataset, by taking the values from a single row or column.- Parameters:
source- the source dataset (nullpermitted).extract- extract data from rows or columns? (nullnot permitted).index- the row or column index.
-
CategoryToPieDataset
Deprecated.Use the other constructor.An adaptor class that converts anyCategoryDatasetinto aPieDataset, by taking the values from a single row or column.- Parameters:
source- the source dataset.extract- ROW or COLUMN.index- the row or column index.
-
-
Method Details
-
getItemCount
public int getItemCount()Returns the number of items (values) in the collection. If the underlying dataset isnull, this method returns zero.- Specified by:
getItemCountin interfaceValues- Returns:
- The item count.
-
getValue
Returns a value. -
getKey
Returns a key.- Specified by:
getKeyin interfaceKeyedValues- Parameters:
index- the item index (zero-based).- Returns:
- The key.
-
getIndex
Returns the index for a given key.- Specified by:
getIndexin interfaceKeyedValues- Parameters:
key- the key.- Returns:
- The index.
-
getKeys
Returns the keys.- Specified by:
getKeysin interfaceKeyedValues- Returns:
- The keys.
-
getValue
Returns the value for a given key. If the key is not recognised, the method should returnnull(but note thatnullcan be associated with a valid key also).- Specified by:
getValuein interfaceKeyedValues- Parameters:
key- the key.- Returns:
- The value (possibly
null).
-
datasetChanged
Passes theDatasetChangeEventthrough.- Specified by:
datasetChangedin interfaceDatasetChangeListener- Parameters:
event- the event.
-