com.jrefinery.data
Class DefaultPieDataset

java.lang.Object
  extended by com.jrefinery.data.AbstractDataset
      extended by 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.


Field Summary
protected  java.util.List keys
          Storage for keys
protected  java.util.List vals
          Storage for values
 
Fields inherited from class com.jrefinery.data.AbstractDataset
listeners
 
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 com.jrefinery.data.AbstractDataset
addChangeListener, fireDatasetChanged, notifyListeners, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jrefinery.data.Dataset
addChangeListener, removeChangeListener
 

Field Detail

keys

protected java.util.List keys
Storage for keys


vals

protected java.util.List vals
Storage for values

Constructor Detail

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:
value - A collection of values.
Method Detail

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.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.