maze.geometry
Class Coordinate

java.lang.Object
  extended bymaze.geometry.Coordinate

public class Coordinate
extends java.lang.Object

Bean which defines a location in the Maze using a two-dimensional coordinate space. For rectangular grids, this is self-evident. But for hexagonal grids, there is a transformation from hex coordinates to rectangular graphic coordinates. The MazeGeometry does this interpretation. The MazeGeometry also handles transformations to graphic Point coordinates.

See Also:
MazeGeometry

Field Summary
 int x
          Horizontal dimension value.
 int y
          Vertical dimension value.
 
Constructor Summary
Coordinate(int x, int y)
          Constructs a new Coordinate from the given horizontal and vertical values.
 
Method Summary
 int getX()
          Returns the horizontal coordinate.
 int getY()
          Returns the vertical coordinate.
 void setX(int x)
          Sets the horizontal coordinate.
 void setY(int y)
          Sets the vertical cooedinate.
 java.lang.String toString()
          Returns a string representation of this coordinate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public int x
Horizontal dimension value.


y

public int y
Vertical dimension value.

Constructor Detail

Coordinate

public Coordinate(int x,
                  int y)
Constructs a new Coordinate from the given horizontal and vertical values.

Parameters:
x - int horizontal dimension value.
y - int vertical dimension value.
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this coordinate.

Returns:
String representation of this point.

setX

public void setX(int x)
Sets the horizontal coordinate.

Parameters:
x - int horizontal coordinate.

setY

public void setY(int y)
Sets the vertical cooedinate.

Parameters:
y - int vertical coordinate.

getX

public int getX()
Returns the horizontal coordinate.

Returns:
int horizontal coordinate

getY

public int getY()
Returns the vertical coordinate.

Returns:
int vertical coordinate