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

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

public class SimpleIntervalXYDataset
extends AbstractIntervalXYDataset

A quick and dirty sample dataset.


Constructor Summary
SimpleIntervalXYDataset()
          Creates a new dataset.
SimpleIntervalXYDataset(int length, double[] xstart, double[] xend, double[] y)
           
SimpleIntervalXYDataset(int length, double[] xstart, double[] xend, int[] y)
           
 
Method Summary
 void add(int length, double[] xstart, double[] xend, int[] y)
           
 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(int index, java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleIntervalXYDataset

public SimpleIntervalXYDataset()
Creates a new dataset.


SimpleIntervalXYDataset

public SimpleIntervalXYDataset(int length,
                               double[] xstart,
                               double[] xend,
                               double[] y)

SimpleIntervalXYDataset

public SimpleIntervalXYDataset(int length,
                               double[] xstart,
                               double[] xend,
                               int[] y)
Method Detail

add

public void add(int length,
                double[] xstart,
                double[] xend,
                int[] y)

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(int index,
                         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 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 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 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.