Package org.jfree.data
Class DefaultWindDataset
java.lang.Object
org.jfree.data.AbstractDataset
org.jfree.data.AbstractSeriesDataset
org.jfree.data.AbstractXYDataset
org.jfree.data.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 Summary
Constructors Constructor Description DefaultWindDataset()
Constructs a new, empty, dataset.DefaultWindDataset(Object[][][] data)
Constructs a dataset based on the specified data.DefaultWindDataset(String[] seriesNames, Object[][][] data)
Constructs a dataset based on the specified data.DefaultWindDataset(List seriesNames, Object[][][] data)
Constructs a dataset based on the specified data. -
Method Summary
Modifier and Type Method Description int
getItemCount(int series)
Returns the number of items in a series.int
getSeriesCount()
Returns the number of series in the dataset.String
getSeriesName(int series)
Returns the name of a series.Number
getWindDirection(int series, int item)
Returns the wind direction for one item within a series.Number
getWindForce(int series, int item)
Returns the wind force for one item within a series.Number
getXValue(int series, int item)
Returns the x-value for one item within a series.Number
getYValue(int series, int item)
Returns the y-value for one item within a series.static List
seriesNameListFromDataArray(Object[][] data)
Utility method for automatically generating series names.Methods inherited from class org.jfree.data.AbstractXYDataset
getX, getY
Methods inherited from class org.jfree.data.AbstractSeriesDataset
seriesChanged
Methods inherited from class org.jfree.data.AbstractDataset
addChangeListener, clone, getGroup, removeChangeListener, setGroup, validateObject
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
DefaultWindDataset
public DefaultWindDataset()Constructs a new, empty, dataset. -
DefaultWindDataset
Constructs a dataset based on the specified data.- Parameters:
data
- the data.
-
DefaultWindDataset
Constructs a dataset based on the specified data.- Parameters:
seriesNames
- the names of the series.data
- the wind data.
-
DefaultWindDataset
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 interfaceSeriesDataset
- Specified by:
getSeriesCount
in classAbstractSeriesDataset
- Returns:
- The series count.
-
getItemCount
public int getItemCount(int series)Returns the number of items in a series.- Specified by:
getItemCount
in interfaceXYDataset
- Parameters:
series
- the series (zero-based index).- Returns:
- The item count.
-
getSeriesName
Returns the name of a series.- Specified by:
getSeriesName
in interfaceSeriesDataset
- Specified by:
getSeriesName
in classAbstractSeriesDataset
- Parameters:
series
- the series (zero-based index).- Returns:
- The series name.
-
getXValue
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. -
getYValue
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. -
getWindDirection
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 interfaceWindDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).- Returns:
- The wind direction for the item within the series.
-
getWindForce
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 interfaceWindDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).- Returns:
- The wind force for the item within the series.
-
seriesNameListFromDataArray
Utility method for automatically generating series names.- Parameters:
data
- the wind dataset.- Returns:
- An array of Series N with N = { 1 .. data.length }.
-