Class Point2D.Float
java.lang.Object
java.awt.geom.Point2D
java.awt.geom.Point2D.Float
- All Implemented Interfaces:
Serializable, Cloneable
- Enclosing class:
Point2D
The
Float class defines a point specified in float
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.voidsetLocation(float x, float y) Sets the location of thisPoint2Dto the specifiedfloatcoordinates.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.Finalization is deprecated and subject to removal in a future release.final Class<?> getClass()Returns the runtime class of thisObject.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
x
public float xThe X coordinate of thisPoint2D.- Since:
- 1.2
-
y
public float yThe Y coordinate of thisPoint2D.- Since:
- 1.2
-
-
Constructor Details
-
Float
public Float()Constructs and initializes aPoint2Dwith coordinates (0, 0).- Since:
- 1.2
-
Float
public Float(float x, float 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
-
setLocation
public void setLocation(float x, float y) Sets the location of thisPoint2Dto the specifiedfloatcoordinates.- Parameters:
x- the new X coordinate of thisPoint2Dy- the new Y coordinate of thisPoint2D- Since:
- 1.2
-
toString
-