tasks
Class Board

java.lang.Object
  extended by tasks.Board
All Implemented Interfaces:
java.io.Serializable

public class Board
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
Board(double row, double col, int[][] userInput)
          Constructor to be called by the SudokuTask.
 
Method Summary
 Cell getCell(int x, int y)
          Get the cell at row x and column y.
 int getSize()
          Get the dimension of one side of the grid.
 void printBoard()
          Prints the entire grid with each cell's associated values.
 void printBoardPossibleValues()
          Prints the each cell in the grid the the possible values each cell could potentially take.
 boolean setCell(int x, int y, int value)
          Sets the cell at the specified coordinates to the value if none of the associated constraints conflict.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Board

public Board(double row,
             double col,
             int[][] userInput)
Constructor to be called by the SudokuTask. Specifies the partially completed board to be solved.

Parameters:
row - The number of rows to be in the board.
col - The number of columns to be in the board.
userInput - The initial values set for a partially completed grid.
Method Detail

printBoard

public void printBoard()
Prints the entire grid with each cell's associated values.


printBoardPossibleValues

public void printBoardPossibleValues()
Prints the each cell in the grid the the possible values each cell could potentially take.


getCell

public Cell getCell(int x,
                    int y)
Get the cell at row x and column y.

Parameters:
x - The row coordinate.
y - The column coordinate.
Returns:
The Cell at the specified coordinate.

getSize

public int getSize()
Get the dimension of one side of the grid.

Returns:
int The dimension of one side of the grid.

setCell

public boolean setCell(int x,
                       int y,
                       int value)
Sets the cell at the specified coordinates to the value if none of the associated constraints conflict.

Parameters:
x - The row coordinate.
y - The row coordinate.
value - The value to be set.
Returns:
True if the cell was set sucessfully. False if the cell failed to set.