|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.keang.sudoku.SudokuSolver
public class SudokuSolver
A Sudoku puzzle solver
Field Summary | |
---|---|
static int |
GRID_SIZE
|
static int |
SUB_GRID_SIZE
|
Constructor Summary | |
---|---|
SudokuSolver()
|
|
SudokuSolver(java.lang.String[] args)
|
Method Summary | |
---|---|
void |
addSolverListener(SolverListener listener)
Adds a solver listener to all solvers |
(package private) int |
compute()
Runs the solvers |
Puzzle |
getPuzzle()
Gets the puzzle |
SequenceBuffer |
getSequenceBuffer()
|
(package private) boolean |
isInBounds(int num)
Checks the value is between 1 and GRID_SIZE inclusive |
static void |
main(java.lang.String[] args)
|
(package private) void |
print()
dumps a formatted view of resolved values to the screen |
void |
printDetail()
Dumps a formatted view of possible values for each cell to the screen |
void |
removeSolverListener(SolverListener listener)
Removes the solver listener from all solvers |
void |
setPuzzle(Puzzle p)
Sets the solvers puzzle grid to this puzzles grid |
void |
setSequenceBuffer(SequenceBuffer buf)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SUB_GRID_SIZE
public static final int GRID_SIZE
Constructor Detail |
---|
public SudokuSolver()
public SudokuSolver(java.lang.String[] args)
Method Detail |
---|
public Puzzle getPuzzle()
public void setPuzzle(Puzzle p)
the
- puzzleboolean isInBounds(int num)
num
-
int compute() throws IllegalGridException
IllegalGridException
public void addSolverListener(SolverListener listener)
listener
- - the listener to addpublic void removeSolverListener(SolverListener listener)
listener
- - the listener to removepublic void printDetail()
void print()
public SequenceBuffer getSequenceBuffer()
public void setSequenceBuffer(SequenceBuffer buf)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |