Fields
Name | Description |
---|---|
x | The x coordinate. |
y | The y coordinate. |
Constructors
Name | Description |
---|---|
Point() | Constructs and initializes a point at the origin (0, 0) of the coordinate space. |
Point(int, int) | Constructs and initializes a point at the specified (x, y) location in the coordinate space. |
Point(Point) | Constructs and initializes a point with the same location as the specified Point object. |
Methods
Name | Description |
---|---|
equals(Object) | Determines whether two points are equal. |
getLocation() | Returns the location of this point. |
hashCode() | Returns the hashcode for this point. |
move(int, int) | Moves this point to the specificed location in the (x, y) coordinate plane. |
setLocation(int, int) | Changes the point to have the specificed location. |
setLocation(Point) | Sets the location of the point to the specificed location. |
toString() | Returns a representation of this point and its location in the (x, y) coordinate space as a string. |
translate(int, int) | 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). |