Package org.jfree.data
Class XYDataItem
java.lang.Object
org.jfree.data.XYDataItem
- All Implemented Interfaces:
Serializable,Cloneable,Comparable
- Direct Known Subclasses:
XYDataPair
public class XYDataItem extends Object implements Cloneable, Comparable, Serializable
Represents one (x, y) data item for an
XYSeries.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description XYDataItem(double x, double y)Constructs a new data pair.XYDataItem(Number x, Number y)Constructs a new data item. -
Method Summary
Modifier and Type Method Description Objectclone()Returns a clone of this object.intcompareTo(Object o1)Returns an integer indicating the order of this object relative to another object.booleanequals(Object o)Tests if this object is equal to another.NumbergetX()Returns the x-value.NumbergetY()Returns the y-value.inthashCode()Returns a hash code.voidsetY(Number y)Sets the y-value for this data pair.
-
Constructor Details
-
XYDataItem
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 pair.- Parameters:
x- the x-value.y- the y-value.
-
-
Method Details
-
getX
Returns the x-value.- Returns:
- the x-value (never
null).
-
getY
Returns the y-value.- Returns:
- the y-value (possibly
null).
-
setY
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 (nullpermitted).
-
compareTo
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- Parameters:
o1- the object being compared to.- Returns:
- an integer indicating the order of this data pair object relative to another object.
-
clone
Returns a clone of this object.- Returns:
- a clone.
- Throws:
CloneNotSupportedException- not thrown by this class, but subclasses may differ.
-
equals
Tests if this object is equal to another. -
hashCode
public int hashCode()Returns a hash code.
-