com.eriksilkensen.sudoku
Class SolvingStrategy

java.lang.Object
  extended by com.eriksilkensen.sudoku.SolvingStrategy
Direct Known Subclasses:
BackTrackingStrategy

public abstract class SolvingStrategy
extends java.lang.Object

Abstract representation of a SolvingStrategy that a Solver uses to solve Sudoku Boards.

Two helper methods are provided that subclasses will probably use while solving Boards.

The only functionality subclasses are required to implement is the actual solving of the Board.

Since:
1.0
Version:
03/15/07
Author:
Erik Silkensen

Constructor Summary
SolvingStrategy()
           
 
Method Summary
 boolean isLegalBoard(Cell[][] cells)
          Helper method
 boolean isLegalCell(Cell val, Cell[][] cells, int row, int col)
          Helper method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SolvingStrategy

public SolvingStrategy()
Method Detail

isLegalCell

public boolean isLegalCell(Cell val,
                           Cell[][] cells,
                           int row,
                           int col)
Helper method

Parameters:
val -
cells -
row -
col -
Returns:
true if val can be legally placed at (row,col) in cells

isLegalBoard

public boolean isLegalBoard(Cell[][] cells)
Helper method

Parameters:
cells -
Returns:
true if every Cell in cells isLegal()