public static class

Point2D.Double

extends Point2D
implements Serializable
java.lang.Object
   ↳ java.awt.geom.Point2D
     ↳ java.awt.geom.Point2D.Double

Class Overview

The Double class defines a point specified in double precision.

Summary

Fields
public double x The X coordinate of this Point2D.
public double y The Y coordinate of this Point2D.
Public Constructors
Point2D.Double()
Constructs and initializes a Point2D with coordinates (0, 0).
Point2D.Double(double x, double y)
Constructs and initializes a Point2D with the specified coordinates.
Public Methods
double getX()
Returns the X coordinate of this Point2D in double precision.
double getY()
Returns the Y coordinate of this Point2D in double precision.
void setLocation(double x, double y)
Sets the location of this Point2D to the specified double coordinates.
String toString()
Returns a String that represents the value of this Point2D.
[Expand]
Inherited Methods
From class java.awt.geom.Point2D
From class java.lang.Object

Fields

public double x

The X coordinate of this Point2D.

public double y

The Y coordinate of this Point2D.

Public Constructors

public Point2D.Double ()

Constructs and initializes a Point2D with coordinates (0, 0).

public Point2D.Double (double x, double y)

Constructs and initializes a Point2D with the specified coordinates.

Parameters
x the X coordinate of the newly constructed Point2D
y the Y coordinate of the newly constructed Point2D

Public Methods

public double getX ()

Returns the X coordinate of this Point2D in double precision.

Returns
  • the X coordinate of this Point2D.

public double getY ()

Returns the Y coordinate of this Point2D in double precision.

Returns
  • the Y coordinate of this Point2D.

public void setLocation (double x, double y)

Sets the location of this Point2D to the specified double coordinates.

Parameters
x the new X coordinate of this Point2D
y the new Y coordinate of this Point2D

public String toString ()

Returns a String that represents the value of this Point2D.

Returns
  • a string representation of this Point2D.