jtge.util.grid.directiongroup
Class AbstractSquareDirectionGroup

java.lang.Object
  extended byjtge.util.grid.directiongroup.AbstractDirectionGroup
      extended byjtge.util.grid.directiongroup.AbstractSquareDirectionGroup
All Implemented Interfaces:
IDirectionGroup
Direct Known Subclasses:
EightDirectionGroup, FourDirectionGroup

public abstract class AbstractSquareDirectionGroup
extends AbstractDirectionGroup

Provides square direction groups common behaviours.

Version:
$Id: AbstractSquareDirectionGroup.java,v 1.2 2005/09/09 19:25:54 mat007 Exp $
Author:
Jean-Laurent

Constructor Summary
AbstractSquareDirectionGroup()
           
 
Method Summary
 Coordinate transform(Coordinate coordinate, East direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, North direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, South direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, West direction)
          Retrieve the coordinate next to another in a given direction.
 
Methods inherited from class jtge.util.grid.directiongroup.AbstractDirectionGroup
add, getNames, getShortNames, iterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jtge.util.grid.directiongroup.IDirectionGroup
transform, transform, transform, transform
 

Constructor Detail

AbstractSquareDirectionGroup

public AbstractSquareDirectionGroup()
Method Detail

transform

public final Coordinate transform(Coordinate coordinate,
                                  West direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate

transform

public final Coordinate transform(Coordinate coordinate,
                                  East direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate

transform

public final Coordinate transform(Coordinate coordinate,
                                  North direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate

transform

public final Coordinate transform(Coordinate coordinate,
                                  South direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate


Copyright © 2003-2005 . All Rights Reserved.