com.act365.sudoku
Class InvulnerableState

java.lang.Object
  extended bycom.act365.sudoku.InvulnerableState
All Implemented Interfaces:
IState

public class InvulnerableState
extends java.lang.Object
implements IState

InvulnerableState records the number of cells that would remain unresolved for each given move (ie each cell/value pair).


Constructor Summary
InvulnerableState()
           
 
Method Summary
 void addMove(int x, int y, int value)
          Adds the move (x,y):=v to the state grid.
 void eliminateMove(int x, int y, int value)
          Eliminates the move (x,y):=v from the current state grid.
 void popState(int nMoves)
          Reads the state gris from the stack at the appropriate position.
 void pushState(int nMoves)
          Writes the state grid to the stack at the appropriate position.
 void setup(int boxesAcross, int boxesDown)
          Sets the state grid to the appropriate size.
 java.lang.String toString()
          Produces a string representation of the state grid.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvulnerableState

public InvulnerableState()
Method Detail

setup

public void setup(int boxesAcross,
                  int boxesDown)
Sets the state grid to the appropriate size.

Specified by:
setup in interface IState
See Also:
IState.setup(int,int)

pushState

public void pushState(int nMoves)
Writes the state grid to the stack at the appropriate position.

Specified by:
pushState in interface IState
Parameters:
nMoves - thread position to which state should be written
See Also:
IState.pushState(int)

popState

public void popState(int nMoves)
Reads the state gris from the stack at the appropriate position.

Specified by:
popState in interface IState
Parameters:
nMoves - thread position from which state should be read
See Also:
IState.popState(int)

addMove

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

Specified by:
addMove in interface IState
Parameters:
value - is in the range [0,cellsInRow), not [1,cellsInRow].
Throws:
java.lang.Exception
See Also:
IState.addMove(int, int, int)

eliminateMove

public void eliminateMove(int x,
                          int y,
                          int value)
Eliminates the move (x,y):=v from the current state grid.

Specified by:
eliminateMove in interface IState
Parameters:
value - is in the range [0,cellsInRow), not [1,cellsInRow].
See Also:
IState.eliminateMove(int, int, int)

toString

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

Specified by:
toString in interface IState