java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.AbstractSeriesDataset
org.jfree.data.xy.AbstractXYDataset
org.jfree.data.xy.DefaultWindDataset
- All Implemented Interfaces:
ObjectInputValidation
,Serializable
,Cloneable
,EventListener
,PublicCloneable
,Dataset
,SeriesChangeListener
,SeriesDataset
,WindDataset
,XYDataset
A default implementation of the
WindDataset
interface.- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a new, empty, dataset.DefaultWindDataset
(Object[][][] data) Constructs a dataset based on the specified data array.DefaultWindDataset
(String[] seriesNames, Object[][][] data) Constructs a dataset based on the specified data array.DefaultWindDataset
(List seriesKeys, Object[][][] data) Constructs a dataset based on the specified data array. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks thisWindDataset
for equality with an arbitrary object.int
getItemCount
(int series) Returns the number of items in a series.int
Returns the number of series in the dataset.getSeriesKey
(int series) Returns the key for a series.getWindDirection
(int series, int item) Returns the wind direction for one item within a series.getWindForce
(int series, int item) Returns the wind force for one item within a series.getX
(int series, int item) Returns the x-value for one item within a series.getY
(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.xy.AbstractXYDataset
getDomainOrder, getXValue, getYValue
Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChanged
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, clone, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
Methods inherited from interface org.jfree.chart.util.PublicCloneable
clone
Methods inherited from interface org.jfree.data.general.SeriesDataset
indexOf
Methods inherited from interface org.jfree.data.xy.XYDataset
getDomainOrder, getXValue, getYValue
-
Constructor Details
-
DefaultWindDataset
public DefaultWindDataset()Constructs a new, empty, dataset. Since there are currently no methods to add data to an existing dataset, you should probably use a different constructor. -
DefaultWindDataset
Constructs a dataset based on the specified data array.- Parameters:
data
- the data (null
not permitted).- Throws:
NullPointerException
- ifdata
isnull
.
-
DefaultWindDataset
Constructs a dataset based on the specified data array.- Parameters:
seriesNames
- the names of the series (null
not permitted).data
- the wind data.- Throws:
NullPointerException
- ifseriesNames
isnull
.
-
DefaultWindDataset
Constructs a dataset based on the specified data array. The array can contain multiple series, each series can contain multiple items, and each item is as follows:data[series][item][0]
- the date (either aDate
or aNumber
that is the milliseconds since 1-Jan-1970);data[series][item][1]
- the wind direction (1 - 12, like the numbers on a clock face);data[series][item][2]
- the wind force (1 - 12 on the Beaufort scale)
- Parameters:
seriesKeys
- the names of the series (null
not permitted).data
- the wind dataset (null
not permitted).- Throws:
IllegalArgumentException
- ifseriesKeys
isnull
.IllegalArgumentException
- if the number of series keys does not match the number of series in the array.NullPointerException
- ifdata
isnull
.
-
-
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.
-
getSeriesKey
Returns the key for a series.- Specified by:
getSeriesKey
in interfaceSeriesDataset
- Specified by:
getSeriesKey
in classAbstractSeriesDataset
- Parameters:
series
- the series (zero-based index).- Returns:
- The series key.
-
getX
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. -
getY
Returns the y-value for one item within a series. This maps to thegetWindForce(int, int)
method and is implemented becauseWindDataset
is an extension ofXYDataset
. -
getWindDirection
Returns the wind direction for one item within a series. This is a number between 0 and 12, like the numbers on an upside-down 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 data (null
not permitted).- Returns:
- An array of Series N with N = { 1 .. data.length }.
- Throws:
NullPointerException
- ifdata
isnull
.
-
equals
Checks thisWindDataset
for equality with an arbitrary object. This method returnstrue
if and only if:obj
is notnull
;obj
is an instance ofDefaultWindDataset
;- both datasets have the same number of series containing identical values.
-