java.awt.geom

Class Point2D.Float

public static class Point2D.Float extends Point2D

This class defines a point in float precision.

Since: 1.2

UNKNOWN: updated to 1.4

Field Summary
floatx
The X coordinate.
floaty
The Y coordinate.
Constructor Summary
Float()
Create a new point at (0,0).
Float(float x, float y)
Create a new point at (x,y).
Method Summary
doublegetX()
Return the x coordinate.
doublegetY()
Return the y coordinate.
voidsetLocation(double x, double y)
Sets the location of this point.
voidsetLocation(float x, float y)
Sets the location of this point.
StringtoString()
Returns a string representation of this object.

Field Detail

x

public float x
The X coordinate.

y

public float y
The Y coordinate.

Constructor Detail

Float

public Float()
Create a new point at (0,0).

Float

public Float(float x, float y)
Create a new point at (x,y).

Parameters: x the x coordinate y the y coordinate

Method Detail

getX

public double getX()
Return the x coordinate.

Returns: the x coordinate

getY

public double getY()
Return the y coordinate.

Returns: the y coordinate

setLocation

public void setLocation(double x, double y)
Sets the location of this point.

Parameters: x the new x coordinate y the new y coordinate

setLocation

public void setLocation(float x, float y)
Sets the location of this point.

Parameters: x the new x coordinate y the new y coordinate

toString

public String toString()
Returns a string representation of this object. The format is: "Point2D.Float[" + x + ", " + y + ']'.

Returns: a string representation of this object