com.jrefinery.data
Class XYSeries

java.lang.Object
  extended by com.jrefinery.data.Series
      extended by com.jrefinery.data.XYSeries
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class XYSeries
extends Series

Represents a sequence of zero or more data pairs in the form (x, y).

See Also:
Serialized Form

Field Summary
protected  java.util.List data
          The list of data pairs in the series.
 
Fields inherited from class com.jrefinery.data.Series
description, listeners, name, propertyChangeSupport
 
Constructor Summary
XYSeries(java.lang.String name)
          Constructs a new xy-series that contains no data.
 
Method Summary
 void add(double x, double y)
          Adds a data item to the series.
 void add(java.lang.Number x, java.lang.Number y)
          Adds new data to the series.
 void add(XYDataPair pair)
          Adds a data item to the series.
 void clear()
          Removes all data pairs from the series.
 XYDataPair getDataPair(int index)
          Return the data pair with the specified index.
 int getItemCount()
          Returns the number of items in the series.
 java.lang.Number getXValue(int index)
          Returns the x-value at the specified index.
 java.lang.Number getYValue(int index)
          Returns the y-value at the specified index.
 void update(int item, java.lang.Number y)
          Updates the value of an item in the series.
 
Methods inherited from class com.jrefinery.data.Series
addChangeListener, addPropertyChangeListener, clone, fireSeriesChanged, getDescription, getName, notifyListeners, removeChangeListener, removePropertyChangeListener, setDescription, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected java.util.List data
The list of data pairs in the series.

Constructor Detail

XYSeries

public XYSeries(java.lang.String name)
Constructs a new xy-series that contains no data.

Parameters:
name - The series name.
Method Detail

getItemCount

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

Returns:
The item count.

add

public void add(XYDataPair pair)
         throws SeriesException
Adds a data item to the series.

Parameters:
pair - The (x, y) pair.
Throws:
SeriesException

add

public void add(double x,
                double y)
         throws SeriesException
Adds a data item to the series.

Parameters:
x - The x value.
y - The y value.
Throws:
SeriesException

add

public void add(java.lang.Number x,
                java.lang.Number y)
         throws SeriesException
Adds new data to the series.

Throws an exception if the x-value is a duplicate.

Parameters:
x - The x-value.
y - The y-value.
Throws:
SeriesException

clear

public void clear()
Removes all data pairs from the series.


getDataPair

public XYDataPair getDataPair(int index)
Return the data pair with the specified index.

Parameters:
index - The index.

getXValue

public java.lang.Number getXValue(int index)
Returns the x-value at the specified index.

Parameters:
index - The index.
Returns:
The x-value.

getYValue

public java.lang.Number getYValue(int index)
Returns the y-value at the specified index.

Parameters:
index - The index.
Returns:
The y-value.

update

public void update(int item,
                   java.lang.Number y)
Updates the value of an item in the series.

Parameters:
index - The item (zero based index).
y - The new value.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.