ui.recognizer
Class DataCoordinate

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by java.awt.geom.Point2D.Double
          extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Point2D
Point2D.Double, Point2D.Float
 
Field Summary
 
Fields inherited from class java.awt.geom.Point2D.Double
x, y
 
Constructor Summary
DataCoordinate(DataCoordinate data)
           
DataCoordinate(double aX, double aY)
           
 
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.
 
Methods inherited from class java.awt.geom.Point2D.Double
getX, getY
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataCoordinate

public DataCoordinate(DataCoordinate data)

DataCoordinate

public DataCoordinate(double aX,
                      double aY)
Method Detail

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