
 |
Chapter 19 java.awt Reference |
 |
Point
Name
Point
The Point class encapsulates
a pair of x and y coordinates within a single object.
The coordinate that represents the horizontal position.
The coordinate that represents the vertical position.
- Description
-
Constructs a Point object initialized
to (0, 0).
- Parameters
-
- x
-
Coordinate that represents
the horizontal position.
- y
-
Coordinate that represents
the vertical position.
- Description
-
Constructs a Point object with
an initial position of (x,
y).
- Parameters
-
- p
-
Initial position.
- Description
-
Constructs a Point object with
the same position as p.
- Parameters
-
- object
-
The object to compare.
- Returns
-
true if both points have the
same x and y coordinates, false
otherwise.
- Overrides
-
Object.equals()
- Description
-
Compares two different Point
instances for equivalence.
- Returns
-
Position of this point.
- Description
-
Gets the current position of this Point.
- Returns
-
A hashcode to use the Point
is used as a key in a Hashtable.
- Overrides
-
Object.hashCode()
- Description
-
Generates a hashcode for the Point.
- Parameters
-
- x
-
The new x coordinate.
- y
-
The new y coordinate.
- Description
-
Changes the Point's location
to (x, y).
- Parameters
-
- x
-
The new x coordinate.
- y
-
The new y coordinate.
- Description
-
Changes the Point's location
to (x, y).
- Parameters
-
- p
-
The new location.
- Description
-
Changes the Point's location
to p.
- Returns
-
A string representation of the Point
object.
- Overrides
-
Object.toString()
- Parameters
-
- deltax
-
Amount to move horizontally.
- deltay
-
Amount to move vertically.
- Description
-
Moves the Point to the location
(x+deltax, y+deltay).
|
|