com.act365.sudoku
Interface IState

All Known Implementing Classes:
CellState, InvulnerableState, NumberState

public interface IState

The IState interface is implemented by all the state types used within strategy types to track possible Su Doku solutions.


Method Summary
 void addMove(int x, int y, int v)
          Updates the state grid to account for the move (x,y):=v.
 void eliminateMove(int x, int y, int v)
          Updates the state grid to account for the fact that the move (x,y):=v has been eliminated as a possibility.
 void popState(int nMoves)
          Unwinds a state grid from the thread.
 void pushState(int nMoves)
          Adds a state grid to the thread.
 void setup(int boxesAcross, int boxesDown)
          Sets up the state grid and its thread.
 java.lang.String toString()
          Produces a string representation of the state grid.
 

Method Detail

setup

public void setup(int boxesAcross,
                  int boxesDown)
Sets up the state grid and its thread.


pushState

public void pushState(int nMoves)
Adds a state grid to the thread.

Parameters:
nMoves - thread position to which state should be written

popState

public void popState(int nMoves)
Unwinds a state grid from the thread.

Parameters:
nMoves - thread position from which state should be read

addMove

public void addMove(int x,
                    int y,
                    int v)
             throws java.lang.Exception
Updates the state grid to account for the move (x,y):=v.

Throws:
java.lang.Exception

eliminateMove

public void eliminateMove(int x,
                          int y,
                          int v)
Updates the state grid to account for the fact that the move (x,y):=v has been eliminated as a possibility.


toString

public java.lang.String toString()
Produces a string representation of the state grid.