util
Interface Orientation

All Known Implementing Classes:
Corner, Direction, HexDirection

public interface Orientation

Representation of directional orientations. Known implementing enums: Direction, HexDirection, and Corner

Version:
January 8, 2008

Method Summary
 Orientation clockwise()
          Returns the next clockwise rotation.
 Orientation counterClockwise()
          Returns the next counter-clockwise rotation.
 Point getOffset(Point loc)
          Returns a point offset in this direction according to inverted cartesian coordinates (the same as Graphics objects).
 Orientation reverse()
          Returns the opposite facing direction.
 

Method Detail

clockwise

Orientation clockwise()
Returns the next clockwise rotation.

Returns:
next clockwise orientation

counterClockwise

Orientation counterClockwise()
Returns the next counter-clockwise rotation.

Returns:
next counter-clockwise orientation

reverse

Orientation reverse()
Returns the opposite facing direction.

Returns:
opposing direction

getOffset

Point getOffset(Point loc)
Returns a point offset in this direction according to inverted cartesian coordinates (the same as Graphics objects). In other words coordinates grow toward the lower-right, with shifts as follows: Up = -Y Down = +Y Left = -X Right = +X

Parameters:
loc - location to be offset
Returns:
shifted point