edu.kzoo.grid.gui
Class GridAppController

java.lang.Object
  |
  +--edu.kzoo.grid.gui.GridAppController
Direct Known Subclasses:
ActiveGridAppController

public abstract class GridAppController
extends java.lang.Object

Grid GUI Support Package:
A GridAppController controls the running of a grid application.

Version:
29 February 2004
Author:
Alyce Brady

Constructor Summary
GridAppController()
           
 
Method Summary
 Grid getGrid()
          Gets the application's grid.
 boolean hasReachedStoppingState()
          Determines whether a running application has reached a desired stopping state.
 void restart()
          Re-initializes the state of the grid application for a restart.
 void setGrid(Grid grid)
          Sets the application's grid.
abstract  void step()
          Advances the application one step.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridAppController

public GridAppController()
Method Detail

getGrid

public Grid getGrid()
Gets the application's grid.

Returns:
the grid being controlled

setGrid

public void setGrid(Grid grid)
Sets the application's grid. (Precondition: grid is not null.)

Parameters:
grid - the Grid to act on

step

public abstract void step()
Advances the application one step.


hasReachedStoppingState

public boolean hasReachedStoppingState()
Determines whether a running application has reached a desired stopping state. Examples include whether the mouse in a maze has found the cheese, whether the first (or last) competitor in a race has finished, or whether a chemical reaction has reached equilibrium.

Returns:
true if the application should stop

restart

public void restart()
Re-initializes the state of the grid application for a restart.