public static class

Point2D.Float

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

Class Overview

The Float class defines a point specified in float precision.

Summary

Fields
public float x The X coordinate of this Point2D.
public float y The Y coordinate of this Point2D.
Public Constructors
Point2D.Float()
Constructs and initializes a Point2D with coordinates (0, 0).
Point2D.Float(float x, float 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.
void setLocation(float x, float y)
Sets the location of this Point2D to the specified float 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 float x

The X coordinate of this Point2D.

public float y

The Y coordinate of this Point2D.

Public Constructors

public Point2D.Float ()

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

public Point2D.Float (float x, float 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 void setLocation (float x, float y)

Sets the location of this Point2D to the specified float 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.