|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.geom.Point2D
This class is only the abstract superclass for all objects which store a 2D coordinate. The actual storage representation of the coordinates is left to the subclass.
Inner Class Summary | |
static | Point2D.Double
A point specified in double precision. |
static | Point2D.Float
A point specified in float precision. |
Constructor Summary | |
Point2D()
This is an abstract class that cannot be instantiated directly. |
Method Summary | |
Object | clone()
Creates a new object of the same class as this object. |
static double | distance(double X1,
double Y1,
double X2,
double Y2)
Returns the distance between two points. |
double | distance(double PX,
double PY)
Returns the distance from this point to another. |
double | distance(Point2D pt)
Returns the distance from this point to another. |
static double | distanceSq(double X1,
double Y1,
double X2,
double Y2)
Returns the square of the distance between two points. |
double | distanceSq(double PX,
double PY)
Returns the square of the distance from this point to another. |
double | distanceSq(Point2D pt)
Returns the square of the distance from this point to another. |
boolean | equals(Object obj)
Determines whether two points are equal. |
abstract double | getX()
Returns the X coordinate of the point in double precision. |
abstract double | getY()
Returns the Y coordinate of the point in double precision. |
abstract void | setLocation(double x,
double y)
Sets the location of this point to the specified float coordinates. |
void | setLocation(Point2D p)
Sets the location of this point to the same coordinates as the specified Point object. |
Methods inherited from class java.lang.Object | |
finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
Constructor Detail |
protected Point2D()
Point2D.Float
,
Point2D.Double
,
Point
Method Detail |
public abstract double getX()
public abstract double getY()
public abstract void setLocation(double x, double y)
public void setLocation(Point2D p)
public static double distanceSq(double X1, double Y1, double X2, double Y2)
X1
- the x coordinate of the first point
Y1
- the y coordinate of the first point
X2
- the x coordinate of the second point
Y2
- the y coordinate of the second pointpublic static double distance(double X1, double Y1, double X2, double Y2)
X1
- the x coordinate of the first point
Y1
- the y coordinate of the first point
X2
- the x coordinate of the second point
Y2
- the y coordinate of the second pointpublic double distanceSq(double PX, double PY)
PX
- the x coordinate of the other point
PY
- the y coordinate of the other pointpublic double distanceSq(Point2D pt)
pt
- the other pointpublic double distance(double PX, double PY)
PX
- the x coordinate of the other point
PY
- the y coordinate of the other pointpublic double distance(Point2D pt)
pt
- the other pointpublic Object clone()
Cloneable
public boolean equals(Object obj)
Point2D
are equal if the values of their
x
and y
member fields, representing
their position in the coordinate space, are the same.
obj
- an object to be compared with this point.true
if the object to be compared is
an instance of Point2D
and has
the same values; false
otherwise.
|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |