Class DefaultWindDataset

All Implemented Interfaces:
ObjectInputValidation, Serializable, Cloneable, EventListener, Dataset, SeriesChangeListener, SeriesDataset, WindDataset, XYDataset

public class DefaultWindDataset
extends AbstractXYDataset
implements WindDataset
A default implementation of the WindDataset interface.
Author:
Achilleus Mantzios
See Also:
Serialized Form
  • Constructor Details

    • DefaultWindDataset

      public DefaultWindDataset()
      Constructs a new, empty, dataset.
    • DefaultWindDataset

      public DefaultWindDataset​(Object[][][] data)
      Constructs a dataset based on the specified data.
      Parameters:
      data - the data.
    • DefaultWindDataset

      public DefaultWindDataset​(String[] seriesNames, Object[][][] data)
      Constructs a dataset based on the specified data.
      Parameters:
      seriesNames - the names of the series.
      data - the wind data.
    • DefaultWindDataset

      public DefaultWindDataset​(List seriesNames, Object[][][] data)
      Constructs a dataset based on the specified data.
      Parameters:
      seriesNames - the names of the series.
      data - the wind dataset.
  • Method Details

    • 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 series count.
    • 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 item count.
    • getSeriesName

      public 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 series name.
    • getXValue

      public 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 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 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 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 List seriesNameListFromDataArray​(Object[][] data)
      Utility method for automatically generating series names.
      Parameters:
      data - the wind dataset.
      Returns:
      An array of Series N with N = { 1 .. data.length }.