com.jrefinery.data
Class XYDataPair

java.lang.Object
  extended by com.jrefinery.data.XYDataPair
All Implemented Interfaces:
java.lang.Comparable

public class XYDataPair
extends java.lang.Object
implements java.lang.Comparable

Represents one (x, y) data item for an xy-series.


Field Summary
protected  java.lang.Number x
          The x-value.
protected  java.lang.Number y
          The y-value.
 
Constructor Summary
XYDataPair(double x, double y)
          Constructs a new data pair.
XYDataPair(java.lang.Number x, java.lang.Number y)
          Constructs a new data pair.
 
Method Summary
 int compareTo(java.lang.Object o1)
          Returns an integer indicating the order of this data pair object relative to another object.
 java.lang.Number getX()
          Returns the x-value.
 java.lang.Number getY()
          Returns the y-value.
 void setY(java.lang.Number y)
          Sets the y-value for this data pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

protected java.lang.Number x
The x-value.


y

protected java.lang.Number y
The y-value.

Constructor Detail

XYDataPair

public XYDataPair(java.lang.Number x,
                  java.lang.Number y)
Constructs a new data pair.

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

XYDataPair

public XYDataPair(double x,
                  double y)
Constructs a new data pair.

Parameters:
x - The x-value.
y - The y-value.
Method Detail

getX

public java.lang.Number getX()
Returns the x-value.

Returns:
The x-value.

getY

public java.lang.Number getY()
Returns the y-value.

Returns:
The y-value.

setY

public void setY(java.lang.Number y)
Sets the y-value for this data pair.

Note that there is no corresponding method to change the x-value.

Parameters:
y - The new y-value.

compareTo

public int compareTo(java.lang.Object o1)
Returns an integer indicating the order of this data pair object relative to another object.

For the order we consider only the x-value: negative == "less-than", zero == "equal", positive == "greater-than".

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o1 - The object being compared to.
Returns:
An integer indicating the order of this data pair object relative to another object.


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.