jtge.util.grid.directiongroup
Class EightDirectionGroup

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

public class EightDirectionGroup
extends AbstractSquareDirectionGroup

Implements a direction group for eight directions.

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

Constructor Summary
EightDirectionGroup()
          Create a direction group with eight 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

EightDirectionGroup

public EightDirectionGroup()
Create a direction group with eight 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.