JFreeChart 1.0.14-redhat-2

org.jfree.data.xy
Class XYDataItem

java.lang.Object
  extended by org.jfree.data.xy.XYDataItem
All Implemented Interfaces:
Serializable, Cloneable, Comparable

public class XYDataItem
extends Object
implements Cloneable, Comparable, Serializable

Represents one (x, y) data item for an XYSeries. Note that subclasses are REQUIRED to support cloning.

See Also:
Serialized Form

Constructor Summary
XYDataItem(double x, double y)
          Constructs a new data item.
XYDataItem(Number x, Number y)
          Constructs a new data item.
 
Method Summary
 Object clone()
          Returns a clone of this object.
 int compareTo(Object o1)
          Returns an integer indicating the order of this object relative to another object.
 boolean equals(Object obj)
          Tests if this object is equal to another.
 Number getX()
          Returns the x-value.
 double getXValue()
          Returns the x-value as a double primitive.
 Number getY()
          Returns the y-value.
 double getYValue()
          Returns the y-value as a double primitive.
 int hashCode()
          Returns a hash code.
 void setY(double y)
          Sets the y-value for this data item.
 void setY(Number y)
          Sets the y-value for this data item.
 String toString()
          Returns a string representing this instance, primarily for debugging use.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XYDataItem

public XYDataItem(Number x,
                  Number y)
Constructs a new data item.

Parameters:
x - the x-value (null NOT permitted).
y - the y-value (null permitted).

XYDataItem

public XYDataItem(double x,
                  double y)
Constructs a new data item.

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

getX

public Number getX()
Returns the x-value.

Returns:
The x-value (never null).

getXValue

public double getXValue()
Returns the x-value as a double primitive.

Returns:
The x-value.
Since:
1.0.9
See Also:
getX(), getYValue()

getY

public Number getY()
Returns the y-value.

Returns:
The y-value (possibly null).

getYValue

public double getYValue()
Returns the y-value as a double primitive.

Returns:
The y-value.
Since:
1.0.9
See Also:
getY(), getXValue()

setY

public void setY(double y)
Sets the y-value for this data item. Note that there is no corresponding method to change the x-value.

Parameters:
y - the new y-value.

setY

public void setY(Number y)
Sets the y-value for this data item. Note that there is no corresponding method to change the x-value.

Parameters:
y - the new y-value (null permitted).

compareTo

public int compareTo(Object o1)
Returns an integer indicating the order of this 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 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 Object clone()
Returns a clone of this object.

Overrides:
clone in class Object
Returns:
A clone.

equals

public boolean equals(Object obj)
Tests if this object is equal to another.

Overrides:
equals in class Object
Parameters:
obj - the object to test against for equality (null permitted).
Returns:
A boolean.

hashCode

public int hashCode()
Returns a hash code.

Overrides:
hashCode in class Object
Returns:
A hash code.

toString

public String toString()
Returns a string representing this instance, primarily for debugging use.

Overrides:
toString in class Object
Returns:
A string.

JFreeChart 1.0.14-redhat-2

Copyright © 2001-2012 JFree.org. All Rights Reserved.