public class PrecisePoint extends Object
Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
boolean |
equalsNoPrecision(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
|
String |
toString() |
public PrecisePoint()
public PrecisePoint(double x, double y)
x
- the x coordinate of the pointy
- the y coordinate of the pointpublic PrecisePoint(PrecisePoint point)
PrecisePoint
.point
- the point to be copiedpublic boolean equalsNoPrecision(Object obj, double tolerance)
PrecisePoint
.obj
- the reference object with which to comparetolerance
- the tolerance of the difference between the pointspublic double getX()
public double getY()
public void setX(double x)
x
- the x-coordinatepublic void setY(double y)
y
- the y-coordinateCopyright © 2018. All rights reserved.