Package repast.simphony.space.grid
Class StrictBorders
- java.lang.Object
-
- repast.simphony.space.grid.AbstractGridPointTranslator
-
- repast.simphony.space.grid.StrictBorders
-
- All Implemented Interfaces:
GridPointTranslator
public class StrictBorders extends AbstractGridPointTranslator
Strict border implementation. Any translate or transform outside of the grids dimensions will throw a SpatialException.- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
-
Field Summary
-
Fields inherited from class repast.simphony.space.grid.AbstractGridPointTranslator
dimensions
-
-
Constructor Summary
Constructors Constructor Description StrictBorders()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isToroidal()
True if this grid is toroidal (in the sense that moving off one border makes you appear on the other one), otherwise false.void
translate(int[] location, int... displacement)
Translate the specified location by the specified displacement.-
Methods inherited from class repast.simphony.space.grid.AbstractGridPointTranslator
boundsCheck, init, transform, transform
-
-
-
-
Method Detail
-
isToroidal
public boolean isToroidal()
True if this grid is toroidal (in the sense that moving off one border makes you appear on the other one), otherwise false. This always returns false.- Returns:
- always false.
-
translate
public void translate(int[] location, int... displacement)
Translate the specified location by the specified displacement. The new location will stored in the location array. For example, if the location is (3, 4) and the displacement is (1, -2), the new location will be (4, 2). If the translated location is outside of the grid dimensions, then a SpatialException is thrown.- Parameters:
location
- the current locationdisplacement
- the amount to translate- Throws:
SpatialException
- if the new location as calculated from current location and displacement is outside of the grid's dimensions.
-
-