All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.Point

java.lang.Object
   |
   +----java.awt.Point

public class Point
extends Object
implements Serializable
A point representing a location in (x, y) coordinate space.


Variable Index

 o x
The x coordinate.
 o y
The y coordinate.

Constructor Index

 o Point()
Constructs and initializes a Point initialized with (0, 0).
 o Point(int, int)
Constructs and initializes a Point from the specified x and y coordinates.
 o Point(Point)
Constructs and initializes a Point with the same location as the specified Point.

Method Index

 o equals(Object)
Checks whether two pointers are equal.
 o getLocation()
Returns the location of this point.
 o hashCode()
Returns the hashcode for this Point.
 o move(int, int)
Changes the point to have the specified location.
 o setLocation(int, int)
Changes the point to have the specificed location.
 o setLocation(Point)
Changes the point to have the specificed location.
 o toString()
Returns the String representation of this Point's coordinates.
 o translate(int, int)
Translates the point.

Variables

 o x
 public int x
The x coordinate.

 o y
 public int y
The y coordinate.

Constructors

 o Point
 public Point()
Constructs and initializes a Point initialized with (0, 0).

 o Point
 public Point(Point p)
Constructs and initializes a Point with the same location as the specified Point.

Parameters:
p - a point
 o Point
 public Point(int x,
              int y)
Constructs and initializes a Point from the specified x and y coordinates.

Parameters:
x - the x coordinate
y - the y coordinate

Methods

 o getLocation
 public Point getLocation()
Returns the location of this point. This method is included for completeness, to parallel the getLocation method of Component.

 o setLocation
 public void setLocation(Point p)
Changes the point to have the specificed location. This method is included for completeness, to parallel the setLocation method of Component.

Parameters:
p - the new location for the point
 o setLocation
 public void setLocation(int x,
                         int y)
Changes the point to have the specificed location. This method is included for completeness, to parallel the setLocation method of Component.

Parameters:
x - the x coordinate of the new location
y - the y coordinate of the new location
 o move
 public void move(int x,
                  int y)
Changes the point to have the specified location.

Parameters:
x - the x coordinate of the new location
y - the y coordinate of the new location
 o translate
 public void translate(int x,
                       int y)
Translates the point.

 o hashCode
 public int hashCode()
Returns the hashcode for this Point.

Overrides:
hashCode in class Object
 o equals
 public boolean equals(Object obj)
Checks whether two pointers are equal.

Overrides:
equals in class Object
 o toString
 public String toString()
Returns the String representation of this Point's coordinates.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index