Package org.jfree.chart.demo
Class SampleXYDataset
java.lang.Object
org.jfree.data.AbstractDataset
org.jfree.data.AbstractSeriesDataset
org.jfree.data.AbstractXYDataset
org.jfree.chart.demo.SampleXYDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,Dataset,SeriesChangeListener,SeriesDataset,XYDataset
public class SampleXYDataset extends AbstractXYDataset implements XYDataset
A dummy dataset for an XY plot.
Note that the aim of this class is to create a self-contained data source for demo purposes - it is NOT intended to show how you should go about writing your own datasets.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description SampleXYDataset()Default constructor. -
Method Summary
Modifier and Type Method Description intgetItemCount(int series)Returns the number of items in the specified series.intgetSeriesCount()Returns the number of series in the dataset.StringgetSeriesName(int series)Returns the name of the series.doublegetTranslate()Returns the translation factor.NumbergetXValue(int series, int item)Returns the x-value for the specified series and item.NumbergetYValue(int series, int item)Returns the y-value for the specified series and item.voidsetTranslate(double translate)Sets the translation constant for the x-axis.Methods inherited from class org.jfree.data.AbstractXYDataset
getX, getYMethods inherited from class org.jfree.data.AbstractSeriesDataset
seriesChangedMethods inherited from class org.jfree.data.AbstractDataset
addChangeListener, clone, getGroup, removeChangeListener, setGroup, validateObjectMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
SampleXYDataset
public SampleXYDataset()Default constructor.
-
-
Method Details
-
getTranslate
public double getTranslate()Returns the translation factor.- Returns:
- the translation factor.
-
setTranslate
public void setTranslate(double translate)Sets the translation constant for the x-axis.- Parameters:
translate- the translation factor.
-
getXValue
Returns the x-value for the specified series and item. Series are numbered 0, 1, ... -
getYValue
Returns the y-value for the specified series and item. Series are numbered 0, 1, ... -
getSeriesCount
public int getSeriesCount()Returns the number of series in the dataset.- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- the number of series in the dataset.
-
getSeriesName
Returns the name of the series.- Specified by:
getSeriesNamein interfaceSeriesDataset- Specified by:
getSeriesNamein classAbstractSeriesDataset- Parameters:
series- the index (zero-based) of the series.- Returns:
- the name of the series.
-
getItemCount
public int getItemCount(int series)Returns the number of items in the specified series.- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the index (zero-based) of the series.- Returns:
- the number of items in the specified series.
-