API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt. Point View Source
Author(s)
Sami Shaio
Since
1.0
Version
1.40, 02/24/06
Serial
Hierarchy
 Object
      Point2D
          Point
Implements
 Serializable
Subclasses
Description
public class Point
  A point representing a location in (x,y) coordinate space, specified in integer precision.
See also:   
Constructors
public Point ()
  Constructs and initializes a point at the origin (0, 0) of the coordinate space.
public Point (int x, int y)
  Constructs and initializes a point at the specified (x,y) location in the coordinate space.
public Point (Point p)
  Constructs and initializes a point with the same location as the specified Point object.
Methods
Hide/Show inherited methods
public Object clone () [Inherited From Point2D]
  Creates a new object of the same class and with the same contents as this object.
public double distance (double px, double py) [Inherited From Point2D]
  Returns the distance from this Point2D to a specified point.
publicstatic double distance (double x1, double y1, double x2, double y2) [Inherited From Point2D]
  Returns the distance between two points.
public double distance (Point2D pt) [Inherited From Point2D]
  Returns the distance from this Point2D to a specified Point2D.
public double distanceSq (double px, double py) [Inherited From Point2D]
  Returns the square of the distance from this Point2D to a specified point.
publicstatic double distanceSq (double x1, double y1, double x2, double y2) [Inherited From Point2D]
  Returns the square of the distance between two points.
public double distanceSq (Point2D pt) [Inherited From Point2D]
  Returns the square of the distance from this Point2D to a specified Point2D.
public boolean equals (Object obj) [Overrides Point2D]
  Determines whether or not two points are equal.
public Point getLocation ()
  Returns the location of this point.
public double getX () [Specified in Point2D]
  Returns the X coordinate of this Point2D in double precision.
public double getY () [Specified in Point2D]
  Returns the Y coordinate of this Point2D in double precision.
public int hashCode () [Inherited From Point2D]
  Returns the hashcode for this Point2D.
public void move (int x, int y)
  Moves this point to the specified location in the (x,y) coordinate plane.
public void setLocation (double x, double y) [Specified in Point2D]
  Sets the location of this point to the specified double coordinates.
public void setLocation (int x, int y)
  Changes the point to have the specified location.
public void setLocation (Point p)
  Sets the location of the point to the specified location.
public void setLocation (Point2D p) [Inherited From Point2D]
  Sets the location of this Point2D to the same coordinates as the specified Point2D object.
public String toString ()
  Returns a string representation of this point and its location in the (x,y) coordinate space.
public void translate (int dx, int dy)
  Translates this point, at location (x,y), by dx along the x axis and dy along the y axis so that it now represents the point (x+dx,y+dy).
Fields
Hide/Show inherited fields
public int x
  The X coordinate of this Point.
public int y
  The Y coordinate of this Point.
Nested Classes
  Point2D.Float
The Float class defines a point specified in float precision.
  Point2D.Double
The Double class defines a point specified in double precision.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar