public class Location extends Object
Constructor and Description |
---|
Location()
Initializes this location to (0, 0).
|
Location(int x,
int y)
Initializes this location with the given x- and y-coordinate.
|
Modifier and Type | Method and Description |
---|---|
Location |
east()
Returns the location east of this location.
|
int |
getX()
Returns the x-coordinate of this location.
|
int |
getY()
Returns the y-coordinate of this location.
|
Location |
north()
Returns the location north of this location.
|
Location |
south()
Returns the location south of this location.
|
String |
toString()
Returns a string representation of this location.
|
Location |
west()
Returns the location west of this location.
|
public Location()
public Location(int x, int y)
x
- x-coordinate of this location.y
- y-coordinate of this location.public int getX()
public int getY()
public Location north()
public Location south()
public Location west()
public Location east()