pythagoras.i

Class Point

• Field Summary

Fields
Modifier and Type Field and Description
`int` `x`
The x-coordinate of the point.
`int` `y`
The y-coordinate of the point.
• Constructor Summary

Constructors
Constructor and Description
`Point()`
Constructs a point at (0, 0).
```Point(int x, int y)```
Constructs a point at the specified coordinates.
`Point(IPoint p)`
Constructs a point with coordinates equal to the supplied point.
• Method Summary

All Methods
Modifier and Type Method and Description
`Point` ```addLocal(int dx, int dy)```
Translates this point by the specified offset.
`void` ```move(int x, int y)```
`Point` ```set(int x, int y)```
Sets the coordinates of this point to the supplied values.
`Point` `set(IPoint p)`
Sets the coordinates of this point to be equal to those of the supplied point.
`void` ```setLocation(int x, int y)```
Sets the coordinates of this point to the supplied values.
`void` `setLocation(IPoint p)`
Sets the coordinates of this point to be equal to those of the supplied point.
`Point` ```subtractLocal(int x, int y)```
Subtracts the supplied x/y from this point.
`void` ```translate(int dx, int dy)```
Translates this point by the specified offset.
`int` `x()`
Returns this point's x-coordinate.
`int` `y()`
Returns this point's y-coordinate.
• Methods inherited from class pythagoras.i.AbstractPoint

`add, add, clone, distance, distance, distanceSq, distanceSq, equals, hashCode, subtract, subtract, subtract, toString`
• Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`
• Field Detail

• x

`public int x`
The x-coordinate of the point.
• y

`public int y`
The y-coordinate of the point.
• Constructor Detail

• Point

`public Point()`
Constructs a point at (0, 0).
• Point

```public Point(int x,
int y)```
Constructs a point at the specified coordinates.
• Point

`public Point(IPoint p)`
Constructs a point with coordinates equal to the supplied point.
• Method Detail

• setLocation

`public void setLocation(IPoint p)`
Sets the coordinates of this point to be equal to those of the supplied point.
• setLocation

```public void setLocation(int x,
int y)```
Sets the coordinates of this point to the supplied values.
• translate

```public void translate(int dx,
int dy)```
Translates this point by the specified offset.
• set

`public Point set(IPoint p)`
Sets the coordinates of this point to be equal to those of the supplied point.
Returns:
a reference to this this, for chaining.
• set

```public Point set(int x,
int y)```
Sets the coordinates of this point to the supplied values.
Returns:
a reference to this this, for chaining.

```public Point addLocal(int dx,
int dy)```
Translates this point by the specified offset.
Returns:
a reference to this point, for chaining.
• subtractLocal

```public Point subtractLocal(int x,
int y)```
Subtracts the supplied x/y from this point.
Returns:
a reference to this point, for chaining.
• x

`public int x()`
Description copied from interface: `IPoint`
Returns this point's x-coordinate.
Specified by:
`x` in interface `IPoint`
• y

`public int y()`
Description copied from interface: `IPoint`
Returns this point's y-coordinate.
Specified by:
`y` in interface `IPoint`