java.awt.geom
Class Point2D.Float

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by java.awt.geom.Point2D.Float
All Implemented Interfaces:
Cloneable
Enclosing class:
Point2D

public static class Point2D.Float
extends Point2D

This class defines a point in float precision.

Since:
1.2

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Point2D
Point2D.Double, Point2D.Float
 
Field Summary
 float x
          The X coordinate.
 float y
          The Y coordinate.
 
Constructor Summary
Point2D.Float()
          Create a new point at (0,0).
Point2D.Float(float x, float y)
          Create a new point at (x,y).
 
Method Summary
 double getX()
          Return the x coordinate.
 double getY()
          Return the y coordinate.
 void setLocation(double x, double y)
          Sets the location of this point.
 void setLocation(float x, float y)
          Sets the location of this point.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public float x
The X coordinate.


y

public float y
The Y coordinate.

Constructor Detail

Point2D.Float

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


Point2D.Float

public Point2D.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.

Specified by:
getX in class Point2D
Returns:
the x coordinate

getY

public double getY()
Return the y coordinate.

Specified by:
getY in class Point2D
Returns:
the y coordinate

setLocation

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

Specified by:
setLocation in class Point2D
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 + ']'.

Overrides:
toString in class Object
Returns:
a string representation of this object
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)