public class XYLocation
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
XYLocation.Direction |
Constructor and Description |
---|
XYLocation(int x,
int y)
Constructs and initializes a location at the specified (x,
y) location in the coordinate space.
|
Modifier and Type | Method and Description |
---|---|
XYLocation |
down()
Returns the location one unit below this location.
|
XYLocation |
east()
Returns the location one unit right of this location.
|
boolean |
equals(java.lang.Object o) |
int |
getXCoOrdinate()
Returns the X coordinate of the location in integer precision.
|
int |
getYCoOrdinate() |
int |
hashCode() |
XYLocation |
left()
Returns the location one unit left of this location.
|
XYLocation |
locationAt(XYLocation.Direction direction)
Returns the location one unit from this location in the specified
direction.
|
XYLocation |
north()
Returns the location one unit ahead of this location.
|
XYLocation |
right()
Returns the location one unit right of this location.
|
XYLocation |
south()
Returns the location one unit behind, this location.
|
java.lang.String |
toString() |
XYLocation |
up()
Returns the location one unit above this location.
|
XYLocation |
west()
Returns the location one unit left of this location.
|
public XYLocation(int x, int y)
x
- the x coordinatey
- the y coordinatepublic int getXCoOrdinate()
public int getYCoOrdinate()
public XYLocation west()
public XYLocation east()
public XYLocation north()
public XYLocation south()
public XYLocation left()
public XYLocation right()
public XYLocation up()
public XYLocation down()
public XYLocation locationAt(XYLocation.Direction direction)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object