ui.recognizer
Class DataCoordinate
java.lang.Object
java.awt.geom.Point2D
java.awt.geom.Point2D.Double
ui.recognizer.DataCoordinate
- All Implemented Interfaces:
- Cloneable, Comparable
public class DataCoordinate
- extends Point2D.Double
- implements Comparable
A class which can represent a data coordinate : an object containing an absissa (x) and ordinate (y) value
and which can be printed and ordered appropriately.
The units are in double precision because the data can represent any real number when calibrated.
When sorted, data coordinates are ordered by their x coordinate.
This class is compatible with java.awt.Point2D
.
- Author:
- John Talbot
Method Summary |
int |
compareTo(Object aDataCoordinate)
Implementation of Comparable so that when sorted, data coordinates are ordered by their x coordinate. |
DataCoordinate |
scale(Calibration aCalibration)
Scale a coordinate using a calibration object. |
void |
setLocation(double aX,
double aY)
|
void |
setX(double aX)
|
void |
setY(double aY)
|
String |
toString()
This method from Object is overidden to provide a standard way to print [x,y] coordinates. |
DataCoordinate
public DataCoordinate(DataCoordinate data)
DataCoordinate
public DataCoordinate(double aX,
double aY)
setLocation
public void setLocation(double aX,
double aY)
- Overrides:
setLocation
in class Point2D.Double
setX
public void setX(double aX)
setY
public void setY(double aY)
scale
public DataCoordinate scale(Calibration aCalibration)
- Scale a coordinate using a calibration object. Note : this data coordinate is modified.
toString
public String toString()
- This method from Object is overidden to provide a standard way to print [x,y] coordinates.
- Overrides:
toString
in class Point2D.Double
compareTo
public int compareTo(Object aDataCoordinate)
- Implementation of Comparable so that when sorted, data coordinates are ordered by their x coordinate.
- Specified by:
compareTo
in interface Comparable