com.sencha.gxt.core.client.util
Class PrecisePoint

java.lang.Object
  extended by com.sencha.gxt.core.client.util.PrecisePoint

public class PrecisePoint
extends java.lang.Object

Represents a double precision point on the (x, y) coordinate plane.


Constructor Summary
PrecisePoint()
          Creates a double precision point.
PrecisePoint(double x, double y)
          Creates a double precision point with the given x and y coordinates.
PrecisePoint(PrecisePoint point)
          Creates a copy of the given PrecisePoint.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 boolean equalsNoPrecision(java.lang.Object obj, double tolerance)
          Indicates whether or not the given object is equal to the rounded values of this PrecisePoint.
 double getX()
          Returns the x coordinate of the point.
 double getY()
          Returns the y coordinate of the point.
 int hashCode()
           
 void setX(double x)
          Sets the x-coordinate.
 void setY(double y)
          Sets the y-coordinate
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrecisePoint

public PrecisePoint()
Creates a double precision point.


PrecisePoint

public PrecisePoint(double x,
                    double y)
Creates a double precision point with the given x and y coordinates.

Parameters:
x - the x coordinate of the point
y - the y coordinate of the point

PrecisePoint

public PrecisePoint(PrecisePoint point)
Creates a copy of the given PrecisePoint.

Parameters:
point - the point to be copied
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

equalsNoPrecision

public boolean equalsNoPrecision(java.lang.Object obj,
                                 double tolerance)
Indicates whether or not the given object is equal to the rounded values of this PrecisePoint.

Parameters:
obj - the reference object with which to compare
tolerance - the tolerance of the difference between the points
Returns:
true if this object is the same as the obj argument; false otherwise

getX

public double getX()
Returns the x coordinate of the point.

Returns:
the x coordinate

getY

public double getY()
Returns the y coordinate of the point.

Returns:
the y coordinate

setX

public void setX(double x)
Sets the x-coordinate.

Parameters:
x - the x-coordinate

setY

public void setY(double y)
Sets the y-coordinate

Parameters:
y - the y-coordinate

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2012. All Rights Reserved.