com.jrefinery.data
Class DefaultWindDataset

java.lang.Object
  extended by com.jrefinery.data.AbstractDataset
      extended by com.jrefinery.data.AbstractSeriesDataset
          extended by com.jrefinery.data.DefaultWindDataset
All Implemented Interfaces:
Dataset, SeriesChangeListener, SeriesDataset, WindDataset, XYDataset

public class DefaultWindDataset
extends AbstractSeriesDataset
implements WindDataset

A default implementation of the WindDataset interface.


Field Summary
protected  java.util.List allSeriesData
          Storage for the series data.
protected  java.util.List seriesNames
          The names of the series.
 
Fields inherited from class com.jrefinery.data.AbstractDataset
listeners
 
Constructor Summary
DefaultWindDataset()
          Constructs a new, empty, WindDataset.
DefaultWindDataset(java.util.List seriesNames, java.lang.Object[][][] data)
          Constructs a WindDataset based on the specified data.
DefaultWindDataset(java.lang.Object[][][] data)
          Constructs a WindDataset based on the specified data.
DefaultWindDataset(java.lang.String[] seriesNames, java.lang.Object[][][] data)
          Constructs a WindDataset based on the specified data.
 
Method Summary
 int getItemCount(int series)
          Returns the number of items in a series.
 int getSeriesCount()
          Returns the number of series in the dataset.
 java.lang.String getSeriesName(int series)
          Returns the name of a series.
 java.lang.Number getWindDirection(int series, int item)
          Returns the wind direction for one item within a series.
 java.lang.Number getWindForce(int series, int item)
          Returns the wind force for one item within a series.
 java.lang.Number getXValue(int series, int item)
          Returns the x-value for one item within a series.
 java.lang.Number getYValue(int series, int item)
          Returns the y-value for one item within a series.
static java.util.List seriesNameListFromDataArray(java.lang.Object[][] data)
          Utility method for automatically generating series names.
 
Methods inherited from class com.jrefinery.data.AbstractSeriesDataset
getLegendItemCount, getLegendItemLabels, seriesChanged
 
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

seriesNames

protected java.util.List seriesNames
The names of the series.


allSeriesData

protected java.util.List allSeriesData
Storage for the series data.

Constructor Detail

DefaultWindDataset

public DefaultWindDataset()
Constructs a new, empty, WindDataset.


DefaultWindDataset

public DefaultWindDataset(java.lang.Object[][][] data)
Constructs a WindDataset based on the specified data.


DefaultWindDataset

public DefaultWindDataset(java.lang.String[] seriesNames,
                          java.lang.Object[][][] data)
Constructs a WindDataset based on the specified data.


DefaultWindDataset

public DefaultWindDataset(java.util.List seriesNames,
                          java.lang.Object[][][] data)
Constructs a WindDataset based on the specified data.

Method Detail

getSeriesCount

public int getSeriesCount()
Returns the number of series in the dataset.

Specified by:
getSeriesCount in interface SeriesDataset
Specified by:
getSeriesCount in class AbstractSeriesDataset
Returns:
The number of series in the dataset.

getItemCount

public int getItemCount(int series)
Returns the number of items in a series.

Specified by:
getItemCount in interface XYDataset
Parameters:
series - The series (zero-based index).
Returns:
The number of items in a series.

getSeriesName

public java.lang.String getSeriesName(int series)
Returns the name of a series.

Specified by:
getSeriesName in interface SeriesDataset
Specified by:
getSeriesName in class AbstractSeriesDataset
Parameters:
series - The series (zero-based index).
Returns:
The name of the specified series.

getXValue

public java.lang.Number getXValue(int series,
                                  int item)
Returns the x-value for one item within a series. This should represent a point in time, encoded as milliseconds in the same way as java.util.Date.

Specified by:
getXValue in interface XYDataset
Parameters:
series - The series (zero-based index).
item - The item (zero-based index).
Returns:
The x-value for the item within the series.

getYValue

public java.lang.Number getYValue(int series,
                                  int item)
Returns the y-value for one item within a series. This maps to the getWindForce(...) method and is implemented because WindDataset is an extension of XYDataset.

Specified by:
getYValue in interface XYDataset
Parameters:
series - The series (zero-based index).
item - The item (zero-based index).
Returns:
The y-value for the item within the series.

getWindDirection

public java.lang.Number getWindDirection(int series,
                                         int item)
Returns the wind direction for one item within a series. This is a number between 0 and 12, like the numbers on a clock face.

Specified by:
getWindDirection in interface WindDataset
Parameters:
series - The series (zero-based index).
item - The item (zero-based index).
Returns:
The wind direction for the item within the series.

getWindForce

public java.lang.Number getWindForce(int series,
                                     int item)
Returns the wind force for one item within a series. This is a number between 0 and 12, as defined by the Beaufort scale.

Specified by:
getWindForce in interface WindDataset
Parameters:
series - The series (zero-based index).
item - The item (zero-based index).
Returns:
The wind force for the item within the series.

seriesNameListFromDataArray

public static java.util.List seriesNameListFromDataArray(java.lang.Object[][] data)
Utility method for automatically generating series names.



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.