Package org.jfree.chart.demo
Class SampleXYDataset2
java.lang.Object
org.jfree.data.AbstractDataset
org.jfree.data.AbstractSeriesDataset
org.jfree.data.AbstractXYDataset
org.jfree.chart.demo.SampleXYDataset2
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,Dataset,DomainInfo,RangeInfo,SeriesChangeListener,SeriesDataset,XYDataset
public class SampleXYDataset2 extends AbstractXYDataset implements XYDataset, DomainInfo, RangeInfo
Random data for a scatter plot demo.
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 SampleXYDataset2()Creates a sample dataset using default settings (4 series, 100 data items per series, random data in the range 0 - 200).SampleXYDataset2(int seriesCount, int itemCount)Creates a sample dataset. -
Method Summary
Modifier and Type Method Description RangegetDomainRange()Returns the range of values in the domain.intgetItemCount(int series)Returns the number of items in the specified series.NumbergetMaximumDomainValue()Returns the maximum domain value.NumbergetMaximumRangeValue()Returns the maximum range value.NumbergetMinimumDomainValue()Returns the minimum domain value.NumbergetMinimumRangeValue()Returns the minimum range value.intgetSeriesCount()Returns the number of series in the dataset.StringgetSeriesName(int series)Returns the name of the series.RangegetValueRange()Returns the range of values in the range (y-values).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.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
-
SampleXYDataset2
public SampleXYDataset2()Creates a sample dataset using default settings (4 series, 100 data items per series, random data in the range 0 - 200). -
SampleXYDataset2
public SampleXYDataset2(int seriesCount, int itemCount)Creates a sample dataset.- Parameters:
seriesCount- the number of series.itemCount- the number of items.
-
-
Method Details
-
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 series count.
-
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.
-
getMinimumDomainValue
Returns the minimum domain value.- Specified by:
getMinimumDomainValuein interfaceDomainInfo- Returns:
- the minimum domain value.
-
getMaximumDomainValue
Returns the maximum domain value.- Specified by:
getMaximumDomainValuein interfaceDomainInfo- Returns:
- the maximum domain value.
-
getDomainRange
Returns the range of values in the domain.- Specified by:
getDomainRangein interfaceDomainInfo- Returns:
- the range.
-
getMinimumRangeValue
Returns the minimum range value.- Specified by:
getMinimumRangeValuein interfaceRangeInfo- Returns:
- the minimum range value.
-
getMaximumRangeValue
Returns the maximum range value.- Specified by:
getMaximumRangeValuein interfaceRangeInfo- Returns:
- the maximum range value.
-
getValueRange
Returns the range of values in the range (y-values).- Specified by:
getValueRangein interfaceRangeInfo- Returns:
- the range.
-