jtge.util.grid.directiongroup
Class AbstractPeakHexagonDirectionGroup

java.lang.Object
  extended byjtge.util.grid.directiongroup.AbstractDirectionGroup
      extended byjtge.util.grid.directiongroup.AbstractPeakHexagonDirectionGroup
All Implemented Interfaces:
IDirectionGroup
Direct Known Subclasses:
PeakHexagonDirectionGroup, PeakShiftedHexagonDirectionGroup

public abstract class AbstractPeakHexagonDirectionGroup
extends AbstractDirectionGroup

Abstract Hexagon Direction Group for Peak Hexagon Grid.

Version:
$Id: AbstractPeakHexagonDirectionGroup.java,v 1.3 2005/09/10 11:23:52 mat007 Exp $
Author:
Jean-Laurent Fabre de Morlhon

Constructor Summary
AbstractPeakHexagonDirectionGroup()
          Create an asbtract direction group for peak hexagon grids.
 
Method Summary
protected abstract  boolean shift(Coordinate coordinate)
          Test if a given coordinate must be shifted.
 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, 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, South 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.
 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
 

Constructor Detail

AbstractPeakHexagonDirectionGroup

public AbstractPeakHexagonDirectionGroup()
Create an asbtract direction group for peak hexagon grids.

Method Detail

shift

protected abstract boolean shift(Coordinate coordinate)
Test if a given coordinate must be shifted.

Parameters:
coordinate - the coordinate
Returns:
whether the coordinate must be shifted or not

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

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

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


Copyright © 2003-2005 . All Rights Reserved.