edu.ucla.stat.SOCR.chart.data
Class SampleXYDataset

java.lang.Object
  extended by org.jfree.data.general.AbstractDataset
      extended by org.jfree.data.general.AbstractSeriesDataset
          extended by org.jfree.data.xy.AbstractXYDataset
              extended by edu.ucla.stat.SOCR.chart.data.SampleXYDataset
All Implemented Interfaces:
java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, org.jfree.data.general.Dataset, org.jfree.data.general.SeriesChangeListener, org.jfree.data.general.SeriesDataset, org.jfree.data.xy.XYDataset

public class SampleXYDataset
extends org.jfree.data.xy.AbstractXYDataset
implements org.jfree.data.xy.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
SampleXYDataset()
          Default constructor.
 
Method Summary
 int getItemCount(int series)
          Returns the number of items in the specified series.
 int getSeriesCount()
          Returns the number of series in the dataset.
 java.lang.Comparable getSeriesKey(int series)
          Returns the key for a series.
 double getTranslate()
          Returns the translation factor.
 java.lang.Number getX(int series, int item)
          Returns the x-value for the specified series and item.
 java.lang.Number getY(int series, int item)
          Returns the y-value for the specified series and item.
 void setTranslate(double translate)
          Sets the translation constant for the x-axis.
 
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, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.data.xy.XYDataset
getDomainOrder, getXValue, getYValue
 
Methods inherited from interface org.jfree.data.general.SeriesDataset
indexOf
 
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
 

Constructor Detail

SampleXYDataset

public SampleXYDataset()
Default constructor.

Method Detail

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.

getX

public java.lang.Number getX(int series,
                             int item)
Returns the x-value for the specified series and item. Series are numbered 0, 1, ...

Specified by:
getX in interface org.jfree.data.xy.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.

getY

public java.lang.Number getY(int series,
                             int item)
Returns the y-value for the specified series and item. Series are numbered 0, 1, ...

Specified by:
getY in interface org.jfree.data.xy.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 org.jfree.data.general.SeriesDataset
Specified by:
getSeriesCount in class org.jfree.data.general.AbstractSeriesDataset
Returns:
the number of series in the dataset.

getSeriesKey

public java.lang.Comparable getSeriesKey(int series)
Returns the key for a series.

Specified by:
getSeriesKey in interface org.jfree.data.general.SeriesDataset
Specified by:
getSeriesKey in class org.jfree.data.general.AbstractSeriesDataset
Parameters:
series - the index (zero-based) of the series.
Returns:
The key for the series.

getItemCount

public int getItemCount(int series)
Returns the number of items in the specified series.

Specified by:
getItemCount in interface org.jfree.data.xy.XYDataset
Parameters:
series - the index (zero-based) of the series.
Returns:
the number of items in the specified series.