Class HiResPoint

java.lang.Object
  |
  +--HiResPoint

public class HiResPoint
extends java.lang.Object

A HiResPoint is like a simplified version of java.awt.Point, but it maintains its coordinates as doubles instead of integers. This class is useful when one simply needs to keep track of coordinate pairs, but the fractional part of the coordinates is significant.

Version:
$Id: HiResPoint.java,v 1.3 2001/11/26 01:21:27 srevilak Exp $
Author:
Steve Revilak

Field Summary
 double x
          The x coorinate of this point
 double y
          The y coordinate of this point
 
Constructor Summary
HiResPoint()
          Construct a new point whose coorinates are (0.0, 0.0)
HiResPoint(double x, double y)
          Construct a new point with the specified set of coordinates
HiResPoint(HiResPoint p)
          Construct a new HiResPoint from an existing one.
HiResPoint(java.awt.Point p)
          Construct a new HiResPoint from the given java.awt.point
 
Method Summary
 boolean equals(HiResPoint p)
          Test to see if the given point has the same x and y coordinates as this one
 java.awt.Point pointValue()
          Create a new java.awt.Point from this HiResPoint, where the coordinate of the awt point are the rounded coordinates of this point
 java.lang.String toString()
          Return a string representation of this HiResPoint.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x
The x coorinate of this point

y

public double y
The y coordinate of this point
Constructor Detail

HiResPoint

public HiResPoint()
Construct a new point whose coorinates are (0.0, 0.0)

HiResPoint

public HiResPoint(double x,
                  double y)
Construct a new point with the specified set of coordinates
Parameters:
x - the x coordinate
y - the y coordinate

HiResPoint

public HiResPoint(HiResPoint p)
Construct a new HiResPoint from an existing one.
Parameters:
p - the existing HiResPoint

HiResPoint

public HiResPoint(java.awt.Point p)
Construct a new HiResPoint from the given java.awt.point
Parameters:
p - the existing java.awt.Point
Method Detail

toString

public java.lang.String toString()
Return a string representation of this HiResPoint.
Overrides:
toString in class java.lang.Object
Returns:
A string representation, suitable for debugging

equals

public boolean equals(HiResPoint p)
Test to see if the given point has the same x and y coordinates as this one
Parameters:
p - the other HiResPoint
Returns:
true if the coordinates match, false otherwise

pointValue

public java.awt.Point pointValue()
Create a new java.awt.Point from this HiResPoint, where the coordinate of the awt point are the rounded coordinates of this point
Returns:
a new java.awt.Point