org.jfree.data.category
Class CategoryToPieDataset
- Cloneable, Dataset, DatasetChangeListener, EventListener, KeyedValues, ObjectInputValidation, PieDataset, Serializable, Values
void | datasetChanged(DatasetChangeEvent event) - Sends a
DatasetChangeEvent to all registered listeners, with
this (not the underlying) dataset as the source.
|
boolean | equals(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.
|
TableOrder | getExtractType() - Returns the extract type, which determines whether data is read from
one row or one column of the underlying dataset.
|
int | getIndex(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.
|
Comparable | getKey(int index) - Returns the key at the specified index.
|
List | getKeys() - Returns the keys for the dataset.
|
CategoryDataset | getUnderlyingDataset() - Returns the underlying dataset.
|
Number | getValue(Comparable key) - Returns the value for a given key.
|
Number | getValue(int item) - Returns a value from the dataset.
|
CategoryToPieDataset
public CategoryToPieDataset(CategoryDataset source,
TableOrder extract,
int index)
An adaptor class that converts any
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.
equals
public boolean equals(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.
obj
- the object to test (null
permitted).
getExtractIndex
public int getExtractIndex()
Returns the index of the row or column from which to extract the data.
getExtractType
public TableOrder getExtractType()
Returns the extract type, which determines whether data is read from
one row or one column of the underlying dataset.
getIndex
public int getIndex(Comparable key)
Returns the index for a given key, or -1
if there is no
such key.
- getIndex in interface KeyedValues
- The index for the key, or
-1
.
getItemCount
public int getItemCount()
Returns the number of items (values) in the collection. If the
underlying dataset is null
, this method returns zero.
- getItemCount in interface Values
getKey
public Comparable getKey(int index)
Returns the key at the specified index.
- getKey in interface KeyedValues
index
- the item index (in the range 0
to
getItemCount() - 1
).
getKeys
public List getKeys()
Returns the keys for the dataset.
If the underlying dataset is
null
, this method returns an
empty list.
- getKeys in interface KeyedValues
getValue
public Number getValue(Comparable key)
Returns the value for a given key. If the key is not recognised, the
method should return null
(but note that null
can be associated with a valid key also).
- getValue in interface KeyedValues
- The value (possibly
null
).
getValue
public Number getValue(int item)
Returns a value from the dataset.
- getValue in interface Values
item
- the item index (zero-based).
- The value (possibly
null
).