Class Point2D.Double
java.lang.Object
java.awt.geom.Point2D
java.awt.geom.Point2D.Double
- All Implemented Interfaces:
Serializable, Cloneable
- Enclosing class:
Point2D
The
Double class defines a point specified in
double precision.- Since:
- 1.2
- See Also:
-
Nested Class Summary
Nested classes/interfaces declared in class Point2D
Point2D.Double, Point2D.FloatModifier and TypeClassDescriptionstatic classTheDoubleclass defines a point specified indoubleprecision.static classTheFloatclass defines a point specified in float precision. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetX()Returns the X coordinate of thisPoint2Dindoubleprecision.doublegetY()Returns the Y coordinate of thisPoint2Dindoubleprecision.voidsetLocation(double x, double y) Sets the location of thisPoint2Dto the specifieddoublecoordinates.toString()Returns aStringthat represents the value of thisPoint2D.Methods declared in class Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocationModifier and TypeMethodDescriptionclone()Creates a new object of the same class and with the same contents as this object.doubledistance(double px, double py) Returns the distance from thisPoint2Dto a specified point.static doubledistance(double x1, double y1, double x2, double y2) Returns the distance between two points.doubleReturns the distance from thisPoint2Dto a specifiedPoint2D.doubledistanceSq(double px, double py) Returns the square of the distance from thisPoint2Dto a specified point.static doubledistanceSq(double x1, double y1, double x2, double y2) Returns the square of the distance between two points.doubledistanceSq(Point2D pt) Returns the square of the distance from thisPoint2Dto a specifiedPoint2D.booleanDetermines whether or not two points are equal.inthashCode()Returns the hashcode for thisPoint2D.voidSets the location of thisPoint2Dto the same coordinates as the specifiedPoint2Dobject.Methods declared in class Object
finalize, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Field Details
-
x
public double xThe X coordinate of thisPoint2D.- Since:
- 1.2
-
y
public double yThe Y coordinate of thisPoint2D.- Since:
- 1.2
-
-
Constructor Details
-
Double
public Double()Constructs and initializes aPoint2Dwith coordinates (0, 0).- Since:
- 1.2
-
Double
public Double(double x, double y) Constructs and initializes aPoint2Dwith the specified coordinates.- Parameters:
x- the X coordinate of the newly constructedPoint2Dy- the Y coordinate of the newly constructedPoint2D- Since:
- 1.2
-
-
Method Details
-
getX
-
getY
-
setLocation
public void setLocation(double x, double y) Sets the location of thisPoint2Dto the specifieddoublecoordinates.- Specified by:
setLocationin classPoint2D- Parameters:
x- the new X coordinate of thisPoint2Dy- the new Y coordinate of thisPoint2D- Since:
- 1.2
-
toString
-