Package org.jfree.chart.demo
Class SampleSignalDataset
java.lang.Object
org.jfree.data.AbstractDataset
org.jfree.data.AbstractSeriesDataset
org.jfree.data.AbstractXYDataset
org.jfree.chart.demo.SampleSignalDataset
- All Implemented Interfaces:
ObjectInputValidation
,Serializable
,Cloneable
,EventListener
,Dataset
,SeriesChangeListener
,SeriesDataset
,SignalsDataset
,XYDataset
public class SampleSignalDataset extends AbstractXYDataset implements SignalsDataset
A sample signal dataset.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from interface org.jfree.data.SignalsDataset
ENTER_LONG, ENTER_SHORT, EXIT_LONG, EXIT_SHORT
-
Constructor Summary
Constructors Constructor Description SampleSignalDataset()
Default constructor. -
Method Summary
Modifier and Type Method Description void
addChangeListener(DatasetChangeListener listener)
Registers an object to receive notification of changes to the dataset.int
getItemCount(int series)
Returns the number of items in a series.double
getLevel(int series, int item)
Returns the level.int
getSeriesCount()
Returns the number of series in the dataset.String
getSeriesName(int series)
Returns the name of a series.int
getType(int series, int item)
Returns the type.Number
getXValue(int series, int item)
Returns the x-value for an item within a series.Number
getYValue(int series, int item)
Returns the y-value for an item within a series.void
removeChangeListener(DatasetChangeListener listener)
Deregisters an object so that it no longer receives notification of changes to the dataset.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
clone, getGroup, setGroup, validateObject
-
Constructor Details
-
SampleSignalDataset
public SampleSignalDataset()Default constructor.
-
-
Method Details
-
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 number of items within the series.
-
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.
-
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 name of the series.
-
getXValue
Returns the x-value for an item within a series.The implementation is responsible for ensuring that the x-values are presented in ascending order.
-
getYValue
Returns the y-value for an item within a series. -
getType
public int getType(int series, int item)Returns the type.- Specified by:
getType
in interfaceSignalsDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).- Returns:
- the type.
-
getLevel
public double getLevel(int series, int item)Returns the level.- Specified by:
getLevel
in interfaceSignalsDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).- Returns:
- the level.
-
addChangeListener
Registers an object to receive notification of changes to the dataset.- Specified by:
addChangeListener
in interfaceDataset
- Overrides:
addChangeListener
in classAbstractDataset
- Parameters:
listener
- the object to register.
-
removeChangeListener
Deregisters an object so that it no longer receives notification of changes to the dataset.- Specified by:
removeChangeListener
in interfaceDataset
- Overrides:
removeChangeListener
in classAbstractDataset
- Parameters:
listener
- the object to deregister.
-