com.jrefinery.chart.demo
Class SampleXYDataset2

java.lang.Object
  |
  +--com.jrefinery.data.AbstractDataset
        |
        +--com.jrefinery.data.AbstractSeriesDataset
              |
              +--com.jrefinery.chart.demo.SampleXYDataset2
All Implemented Interfaces:
Dataset, DomainInfo, RangeInfo, SeriesChangeListener, SeriesDataset, XYDataset

public class SampleXYDataset2
extends AbstractSeriesDataset
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.

Author:
DG

Constructor Summary
SampleXYDataset2()
          Default constructor.
 
Method Summary
 Range getDomainRange()
          Returns the range of values in the domain.
 int getItemCount(int series)
          Returns the number of items in the specified series.
 java.lang.Number getMaximumDomainValue()
          Returns the maximum domain value.
 java.lang.Number getMaximumRangeValue()
          Returns the maximum range value.
 java.lang.Number getMinimumDomainValue()
          Returns the minimum domain value.
 java.lang.Number getMinimumRangeValue()
          Returns the minimum range value.
 int getSeriesCount()
          Returns the number of series in the dataset.
 java.lang.String getSeriesName(int series)
          Returns the name of the series.
 Range getValueRange()
          Returns the range of values in the range (y-values).
 java.lang.Number getXValue(int series, int item)
          Returns the x-value for the specified series and item.
 java.lang.Number getYValue(int series, int item)
          Returns the y-value for the specified series and item.
 
Methods inherited from class com.jrefinery.data.AbstractSeriesDataset
getLegendItemCount, getLegendItemLabels, seriesChanged
 
Methods inherited from class com.jrefinery.data.AbstractDataset
addChangeListener, fireDatasetChanged, getGroup, notifyListeners, removeChangeListener, setGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jrefinery.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
 

Constructor Detail

SampleXYDataset2

public SampleXYDataset2()
Default constructor.
Method Detail

getXValue

public java.lang.Number getXValue(int series,
                                  int item)
Returns the x-value for the specified series and item. Series are numbered 0, 1, ...
Specified by:
getXValue in interface XYDataset
Parameters:
series - the index (zero-based) of the series.
item - the index (zero-based) of the required item.
Returns:
the x-value for the specified series and item.

getYValue

public java.lang.Number getYValue(int series,
                                  int item)
Returns the y-value for the specified series and item. Series are numbered 0, 1, ...
Specified by:
getYValue in interface XYDataset
Parameters:
series - the index (zero-based) of the series.
item - the index (zero-based) of the required item.
Returns:
the y-value for the specified series and item.

getSeriesCount

public int getSeriesCount()
Returns the number of series in the dataset.
Specified by:
getSeriesCount in interface SeriesDataset
Overrides:
getSeriesCount in class AbstractSeriesDataset
Returns:
the series count.

getSeriesName

public java.lang.String getSeriesName(int series)
Returns the name of the series.
Specified by:
getSeriesName in interface SeriesDataset
Overrides:
getSeriesName in class AbstractSeriesDataset
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:
getItemCount in interface XYDataset
Parameters:
series - the index (zero-based) of the series.
Returns:
the number of items in the specified series.

getMinimumDomainValue

public java.lang.Number getMinimumDomainValue()
Returns the minimum domain value.
Specified by:
getMinimumDomainValue in interface DomainInfo
Returns:
the minimum domain value.

getMaximumDomainValue

public java.lang.Number getMaximumDomainValue()
Returns the maximum domain value.
Specified by:
getMaximumDomainValue in interface DomainInfo
Returns:
the maximum domain value.

getDomainRange

public Range getDomainRange()
Returns the range of values in the domain.
Specified by:
getDomainRange in interface DomainInfo
Returns:
the range.

getMinimumRangeValue

public java.lang.Number getMinimumRangeValue()
Returns the minimum range value.
Specified by:
getMinimumRangeValue in interface RangeInfo
Returns:
the minimum range value.

getMaximumRangeValue

public java.lang.Number getMaximumRangeValue()
Returns the maximum range value.
Specified by:
getMaximumRangeValue in interface RangeInfo
Returns:
the maximum range value.

getValueRange

public Range getValueRange()
Returns the range of values in the range (y-values).
Specified by:
getValueRange in interface RangeInfo
Returns:
the range.