- java.lang.Object
-
- org.jfree.data.xy.XYDataItem
-
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<XYDataItem>
public class XYDataItem extends Object implements Cloneable, Comparable<XYDataItem>, Serializable
Represents one (x, y) data item for anXYSeries. Note that subclasses are REQUIRED to support cloning.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XYDataItem(double x, double y)Constructs a new data item.XYDataItem(Number x, Number y)Constructs a new data item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Returns a clone of this object.intcompareTo(XYDataItem other)Returns an integer indicating the order of this object relative to another object.booleanequals(Object obj)Tests if this object is equal to another.NumbergetX()Returns the x-value.doublegetXValue()Returns the x-value as a double primitive.NumbergetY()Returns the y-value.doublegetYValue()Returns the y-value as a double primitive.inthashCode()Returns a hash code.voidsetY(double y)Sets the y-value for this data item.voidsetY(Number y)Sets the y-value for this data item.StringtoString()Returns a string representing this instance, primarily for debugging use.
-
-
-
Constructor Detail
-
XYDataItem
public XYDataItem(Number x, Number y)
Constructs a new data item.- Parameters:
x- the x-value (nullNOT permitted).y- the y-value (nullpermitted).
-
XYDataItem
public XYDataItem(double x, double y)
Constructs a new data item.- Parameters:
x- the x-value.y- the y-value.
-
-
Method Detail
-
getXValue
public double getXValue()
Returns the x-value as a double primitive.- Returns:
- The x-value.
- See Also:
getX(),getYValue()
-
getYValue
public double getYValue()
Returns the y-value as a double primitive.- Returns:
- The y-value.
- 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 (nullpermitted).
-
compareTo
public int compareTo(XYDataItem other)
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:
compareToin interfaceComparable<XYDataItem>- Parameters:
other- the data item being compared to.- Returns:
- An integer indicating the order of this data pair object relative to another object.
-
hashCode
public int hashCode()
Returns a hash code.
-
-