org.jfree.data
Class XYDataPair

java.lang.Object
  |
  +--org.jfree.data.XYDataPair
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable

public class XYDataPair
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable, java.io.Serializable

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

Author:
David Gilbert
See Also:
Serialized Form

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
 java.lang.Object clone()
          Returns a clone of this XYDataPair.
 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
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

clone

public java.lang.Object clone()
Returns a clone of this XYDataPair.

Overrides:
clone in class java.lang.Object
Returns:
a clone of the data pair.