Package io.github.skenvy
Class Cell
- java.lang.Object
-
- io.github.skenvy.Cell
-
public class Cell extends Object
An individual cell in the whole grid.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Cell.SudokuCellCantSetValueOfPredeterminedCellException
class
Cell.SudokuCellException
Used for cell related exceptions.class
Cell.SudokuCellInvalidInitialValueException
-
Constructor Summary
Constructors Constructor Description Cell()
Initialise an empty cell for a standard sudoku board of size 3*3*3*3.Cell(int initialValue)
Initialise a non-empty cell for a standard sudoku board of size 3*3*3*3.Cell(int initialValue, int boardSize)
Initialise a non-empty cell for a sudoku board of arbitrary size.Cell(int initialValue, int boardSize, CellCollection row, CellCollection column, CellCollection box)
Initialise a non-empty cell for a sudoku board of arbitrary size.
-
-
-
Constructor Detail
-
Cell
public Cell()
Initialise an empty cell for a standard sudoku board of size 3*3*3*3.
-
Cell
public Cell(int initialValue) throws Cell.SudokuCellInvalidInitialValueException
Initialise a non-empty cell for a standard sudoku board of size 3*3*3*3.- Parameters:
initialValue
- is used to provide an initial value.- Throws:
Cell.SudokuCellInvalidInitialValueException
- when attempting to create a new Cell with an invalid value
-
Cell
public Cell(int initialValue, int boardSize) throws Cell.SudokuCellInvalidInitialValueException
Initialise a non-empty cell for a sudoku board of arbitrary size.- Parameters:
initialValue
- is used to provide an initial value.boardSize
- is used to specify a row / column length other than 9.- Throws:
Cell.SudokuCellInvalidInitialValueException
- when attempting to create a new Cell with an invalid value
-
Cell
public Cell(int initialValue, int boardSize, CellCollection row, CellCollection column, CellCollection box) throws Cell.SudokuCellInvalidInitialValueException
Initialise a non-empty cell for a sudoku board of arbitrary size.- Parameters:
initialValue
- is used to provide an initial value.boardSize
- is used to specify a row / column length other than 9.- Throws:
Cell.SudokuCellInvalidInitialValueException
- when attempting to create a new Cell with an invalid value
-
-
Method Detail
-
getValue
public int getValue()
-
setValue
public void setValue(int value) throws Cell.SudokuCellCantSetValueOfPredeterminedCellException
-
-