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

java.lang.Object
  extended by AbstractIntervalXYDataset
      extended by edu.ucla.stat.SOCR.chart.data.SimpleIntervalXYDataset2

public class SimpleIntervalXYDataset2
extends AbstractIntervalXYDataset

A quick and dirty sample dataset.


Constructor Summary
SimpleIntervalXYDataset2(int itemCount)
          Creates a new dataset.
SimpleIntervalXYDataset2(int itemCount, double[] x, double[] y1, double[] y2)
           
 
Method Summary
 void addChangeListener(DatasetChangeListener listener)
          Registers an object for notification of changes to the dataset.
 java.lang.Number getEndX(int series, int item)
          Returns the ending X value for the specified series and item.
 java.lang.Number getEndY(int series, int item)
          Returns the ending Y value for the specified series and item.
 int getItemCount(int series)
          Returns the number of items in a series.
 int getSeriesCount()
          Returns the number of series in the dataset.
 java.lang.Comparable getSeriesKey(int series)
          Returns the key for a series.
 java.lang.Number getStartX(int series, int item)
          Returns the starting X value for the specified series and item.
 java.lang.Number getStartY(int series, int item)
          Returns the starting Y value for the specified series and item.
 java.lang.Number getX(int series, int item)
          Returns the x-value for an item within a series.
 java.lang.Number getY(int series, int item)
          Returns the y-value for an item within a series.
 void removeChangeListener(DatasetChangeListener listener)
          Deregisters an object for notification of changes to the dataset.
 void setSeriesKey(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleIntervalXYDataset2

public SimpleIntervalXYDataset2(int itemCount)
Creates a new dataset.

Parameters:
itemCount - the number of items to generate.

SimpleIntervalXYDataset2

public SimpleIntervalXYDataset2(int itemCount,
                                double[] x,
                                double[] y1,
                                double[] y2)
Method Detail

getSeriesCount

public int getSeriesCount()
Returns the number of series in the dataset.

Returns:
the number of series in the dataset.

getSeriesKey

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

Parameters:
series - the series (zero-based index).
Returns:
The series key.

setSeriesKey

public void setSeriesKey(java.lang.String name)

getItemCount

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

Parameters:
series - the series (zero-based index).
Returns:
the number of items within a series.

getX

public java.lang.Number getX(int series,
                             int item)
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.

Parameters:
series - the series (zero-based index).
item - the item (zero-based index).
Returns:
the x-value for an item within a series.

getY

public java.lang.Number getY(int series,
                             int item)
Returns the y-value for an item within a series.

Parameters:
series - the series (zero-based index).
item - the item (zero-based index).
Returns:
the y-value for an item within a series.

getStartX

public java.lang.Number getStartX(int series,
                                  int item)
Returns the starting X value for the specified series and item.

Parameters:
series - the series (zero-based index).
item - the item within a series (zero-based index).
Returns:
the start x value.

getEndX

public java.lang.Number getEndX(int series,
                                int item)
Returns the ending X value for the specified series and item.

Parameters:
series - the series (zero-based index).
item - the item within a series (zero-based index).
Returns:
the end x value.

getStartY

public java.lang.Number getStartY(int series,
                                  int item)
Returns the starting Y value for the specified series and item.

Parameters:
series - the series (zero-based index).
item - the item within a series (zero-based index).
Returns:
the start y value.

getEndY

public java.lang.Number getEndY(int series,
                                int item)
Returns the ending Y value for the specified series and item.

Parameters:
series - the series (zero-based index).
item - the item within a series (zero-based index).
Returns:
the end y value.

addChangeListener

public void addChangeListener(DatasetChangeListener listener)
Registers an object for notification of changes to the dataset.

Parameters:
listener - the object to register.

removeChangeListener

public void removeChangeListener(DatasetChangeListener listener)
Deregisters an object for notification of changes to the dataset.

Parameters:
listener - the object to deregister.