com.jrefinery.data
Class DefaultPieDataset
java.lang.Object
|
+--com.jrefinery.data.AbstractDataset
|
+--com.jrefinery.data.DefaultPieDataset
- All Implemented Interfaces:
- Dataset, PieDataset
- Direct Known Subclasses:
- JdbcPieDataset
- public class DefaultPieDataset
- extends AbstractDataset
- implements PieDataset
A default implementation of the PieDataset interface.
- Author:
- DG
Field Summary |
protected java.util.List |
keys
Storage for keys |
protected java.util.List |
vals
Storage for values |
Constructor Summary |
DefaultPieDataset()
Constructs a pie dataset, initially empty. |
DefaultPieDataset(java.util.Collection values)
Constructs a pie dataset, and populates it with the given values. |
DefaultPieDataset(java.lang.Number[] data)
Constructs a pie dataset and populates it with data from the array. |
Method Summary |
java.util.List |
getCategories()
Returns the categories in the dataset. |
java.lang.Number |
getValue(java.lang.Object category)
Returns the data value for a category. |
void |
setValue(java.lang.Object category,
java.lang.Number value)
Sets the data value for one category in a series. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
keys
protected java.util.List keys
- Storage for keys
vals
protected java.util.List vals
- Storage for values
DefaultPieDataset
public DefaultPieDataset()
- Constructs a pie dataset, initially empty.
DefaultPieDataset
public DefaultPieDataset(java.lang.Number[] data)
- Constructs a pie dataset and populates it with data from the array.
- Parameters:
data
- the data.
DefaultPieDataset
public DefaultPieDataset(java.util.Collection values)
- Constructs a pie dataset, and populates it with the given values.
- Parameters:
values
- a collection of values.
getCategories
public java.util.List getCategories()
- Returns the categories in the dataset.
- Specified by:
getCategories
in interface PieDataset
- Returns:
- the categories in the dataset.
getValue
public java.lang.Number getValue(java.lang.Object category)
- Returns the data value for a category.
- Specified by:
getValue
in interface PieDataset
- Parameters:
category
- the required category.- Returns:
- the data value for a category (null possible).
setValue
public void setValue(java.lang.Object category,
java.lang.Number value)
- Sets the data value for one category in a series.
- Parameters:
category
- the category.value
- the value.