public class XYDataPoint extends Object implements Comparable<XYDataPoint>, Serializable
Constructor and Description |
---|
XYDataPoint(double x,
double y)
Create a new XYDataPoint.
|
XYDataPoint(double x,
double y,
boolean compareBasedOnFirstDataPoint)
Create a new XYDataPoint.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(XYDataPoint o)
Compares based on the x-value or the sum of the x- and y-value, depending
on the compareBasedOnFirstDataPoint settings.
|
double |
getX()
Returns the x value.
|
double |
getY()
Returns the y value.
|
void |
setX(double x)
Set the x value.
|
void |
setY(double y)
Set the y value.
|
String |
toString()
Returns the x-value as a string.
|
public XYDataPoint(double x, double y)
x
- the x valuey
- the y valuepublic XYDataPoint(double x, double y, boolean compareBasedOnFirstDataPoint)
x
- the x valuey
- the y valuecompareBasedOnFirstDataPoint
- if true, the compare method will use
the first data point, false will use the sumpublic double getX()
public void setX(double x)
x
- the x to setpublic double getY()
public void setY(double y)
y
- the y to setpublic String toString()
public int compareTo(XYDataPoint o)
compareTo
in interface Comparable<XYDataPoint>
Copyright © 2016. All rights reserved.