edu.kzoo.grid
Class Grid.BoundedGridValidityChecker

java.lang.Object
  |
  +--edu.kzoo.grid.Grid.BoundedGridValidityChecker
All Implemented Interfaces:
Grid.ValidityChecker
Enclosing class:
Grid

public static class Grid.BoundedGridValidityChecker
extends java.lang.Object
implements Grid.ValidityChecker

A BoundedGridValidityChecker implements a strategy for determining the validity of a location in a bounded grid.


Constructor Summary
Grid.BoundedGridValidityChecker(int rows, int cols)
          Constructs a BoundedGridValidityChecker object.
 
Method Summary
 boolean isValid(Location loc)
          Verifies whether a location is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grid.BoundedGridValidityChecker

public Grid.BoundedGridValidityChecker(int rows,
                                       int cols)
Constructs a BoundedGridValidityChecker object. (Precondition: rows > 0 and cols > 0.)

Parameters:
rows - number of rows in the grid
cols - number of columns in the grid
Method Detail

isValid

public boolean isValid(Location loc)
Verifies whether a location is valid.

Specified by:
isValid in interface Grid.ValidityChecker
Parameters:
loc - location to check
Returns:
true if loc is valid; false otherwise