public class CategoryToPieDataset extends AbstractDataset implements PieDataset, DatasetChangeListener
PieDataset implementation that obtains its data from one row or
column of a CategoryDataset.| Constructor and Description |
|---|
CategoryToPieDataset(CategoryDataset source,
org.jfree.util.TableOrder extract,
int index)
An adaptor class that converts any
CategoryDataset into a
PieDataset, by taking the values from a single row or column. |
| Modifier and Type | Method and Description |
|---|---|
void |
datasetChanged(DatasetChangeEvent event)
Sends a
DatasetChangeEvent to all registered listeners, with
this (not the underlying) dataset as the source. |
boolean |
equals(java.lang.Object obj)
Tests this dataset for equality with an arbitrary object, returning
true if obj is a dataset containing the same
keys and values in the same order as this dataset. |
int |
getExtractIndex()
Returns the index of the row or column from which to extract the data.
|
org.jfree.util.TableOrder |
getExtractType()
Returns the extract type, which determines whether data is read from
one row or one column of the underlying dataset.
|
int |
getIndex(java.lang.Comparable key)
Returns the index for a given key, or
-1 if there is no
such key. |
int |
getItemCount()
Returns the number of items (values) in the collection.
|
java.lang.Comparable |
getKey(int index)
Returns the key at the specified index.
|
java.util.List |
getKeys()
Returns the keys for the dataset.
|
CategoryDataset |
getUnderlyingDataset()
Returns the underlying dataset.
|
java.lang.Number |
getValue(java.lang.Comparable key)
Returns the value for a given key.
|
java.lang.Number |
getValue(int item)
Returns a value from the dataset.
|
addChangeListener, clone, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectfinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, getGroup, removeChangeListener, setGrouppublic CategoryToPieDataset(CategoryDataset source, org.jfree.util.TableOrder extract, int index)
CategoryDataset into a
PieDataset, by taking the values from a single row or column.
If source is null, the created dataset will
be empty.
source - the source dataset (null permitted).extract - extract data from rows or columns? (null
not permitted).index - the row or column index.public CategoryDataset getUnderlyingDataset()
null).public org.jfree.util.TableOrder getExtractType()
public int getExtractIndex()
public int getItemCount()
null, this method returns zero.getItemCount in interface Valuespublic java.lang.Number getValue(int item)
public java.lang.Comparable getKey(int index)
getKey in interface KeyedValuesindex - the item index (in the range 0 to
getItemCount() - 1).java.lang.IndexOutOfBoundsException - if index is not in the
specified range.public int getIndex(java.lang.Comparable key)
-1 if there is no
such key.getIndex in interface KeyedValueskey - the key.-1.public java.util.List getKeys()
If the underlying dataset is null, this method returns an
empty list.
getKeys in interface KeyedValuespublic java.lang.Number getValue(java.lang.Comparable key)
null (but note that null
can be associated with a valid key also).getValue in interface KeyedValueskey - the key.null).public void datasetChanged(DatasetChangeEvent event)
DatasetChangeEvent to all registered listeners, with
this (not the underlying) dataset as the source.datasetChanged in interface DatasetChangeListenerevent - the event (ignored, a new event with this dataset as the
source is sent to the listeners).public boolean equals(java.lang.Object obj)
true if obj is a dataset containing the same
keys and values in the same order as this dataset.equals in class java.lang.Objectobj - the object to test (null permitted).