jtge.util.grid.directiongroup
Class FourDirectionGroup

java.lang.Object
  extended byjtge.util.grid.directiongroup.AbstractDirectionGroup
      extended byjtge.util.grid.directiongroup.AbstractSquareDirectionGroup
          extended byjtge.util.grid.directiongroup.FourDirectionGroup
All Implemented Interfaces:
IDirectionGroup

public class FourDirectionGroup
extends AbstractSquareDirectionGroup

Implements a direction group for four directions.

Version:
$Id: FourDirectionGroup.java,v 1.1 2005/09/09 18:24:28 mat007 Exp $
Author:
Jean-Laurent

Constructor Summary
FourDirectionGroup()
          Create a direction group with four directions.
 
Method Summary
 Coordinate transform(Coordinate coordinate, NorthEast direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, NorthWest direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, SouthEast direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, SouthWest direction)
          Retrieve the coordinate next to another in a given direction.
 
Methods inherited from class jtge.util.grid.directiongroup.AbstractSquareDirectionGroup
transform, transform, transform, transform
 
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
 

Constructor Detail

FourDirectionGroup

public FourDirectionGroup()
Create a direction group with four directions.

Method Detail

transform

public final Coordinate transform(Coordinate coordinate,
                                  NorthEast 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,
                                  NorthWest 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,
                                  SouthEast 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,
                                  SouthWest 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.