A4Shell
Class WrappedBoundedGrid<E>

java.lang.Object
  extended by A4Shell.AbstractGrid<E>
      extended by A4Shell.BoundedGrid<E>
          extended by A4Shell.WrappedBoundedGrid<E>
All Implemented Interfaces:
Grid<E>

public class WrappedBoundedGrid<E>
extends BoundedGrid<E>


Constructor Summary
WrappedBoundedGrid(int rows, int cols)
           
 
Method Summary
 java.util.ArrayList<Location> getValidAdjacentLocations(Location loc)
          Gets the valid locations adjacent to a given location in all eight compass directions (north, northeast, east, southeast, south, southwest, west, and northwest).
 
Methods inherited from class A4Shell.BoundedGrid
get, getNumCols, getNumRows, getOccupiedLocations, isValid, put, remove
 
Methods inherited from class A4Shell.AbstractGrid
getEmptyAdjacentLocations, getNeighbors, getOccupiedAdjacentLocations, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappedBoundedGrid

public WrappedBoundedGrid(int rows,
                          int cols)
Method Detail

getValidAdjacentLocations

public java.util.ArrayList<Location> getValidAdjacentLocations(Location loc)
Description copied from interface: Grid
Gets the valid locations adjacent to a given location in all eight compass directions (north, northeast, east, southeast, south, southwest, west, and northwest).
Precondition: loc is valid in this grid

Specified by:
getValidAdjacentLocations in interface Grid<E>
Overrides:
getValidAdjacentLocations in class AbstractGrid<E>
Parameters:
loc - a location in this grid
Returns:
an array list of the valid locations adjacent to loc in this grid