    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.

##

x
  The x coordinate.
y
  The y coordinate.

##

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

##

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

##

x

      public int x

  The x coordinate.

y

      public int y

  The y coordinate.

##

Point

      public Point()

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

Point

      public Point(Point p)

  Constructs and initializes a Point with the same location as the specified Point.

  Parameters:
    p - a point

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

##

getLocation

      public Point getLocation()

  Returns the location of this point. This method is included for completeness, to parallel the getLocation method of Component.

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

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

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

translate

      public void translate(int x,
                            int y)

  Translates the point.

hashCode

      public int hashCode()

  Returns the hashcode for this Point.

  Overrides:
    hashCode in class Object

equals

      public boolean equals(Object obj)

  Checks whether two pointers are equal.

  Overrides:
    equals in class Object

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