Package org.drools.examples.sudoku
Class Cell
java.lang.Object
org.drools.examples.sudoku.SetOfNine
org.drools.examples.sudoku.Cell
Represents a single cell in the Sudoku grid.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the column group of nine of this cell.Returns the row group of nine of this cell.Returns the 3x3 block group of nine of this cell.intgetColNo()Returns the column number.Return the set of Cell objects where contents are mutually exclusive with this cell; they are in the same row or same column or same block.intgetRowNo()Returns the row number.getValue()Retrieves the value.voidmakeReferences(CellRow row, CellCol col, CellSqr sqr) Set references to all cell groups containing this cell.voidSet the cell value.toString()Methods inherited from class org.drools.examples.sudoku.SetOfNine
blockExcept, blockValue, getFree, getFreeCount, getFreeValue
-
Constructor Details
-
Cell
public Cell()Constructor, leaving all references at null. You must call makeReferences to complete the object.
-
-
Method Details
-
makeReferences
Set references to all cell groups containing this cell.- Parameters:
row- the cell group for the rowcol- the cell group for the columnsqr- the cell group for the square 3x3 area
-
getValue
Retrieves the value.- Returns:
- an Integer or null
-
setValue
Set the cell value.- Parameters:
value- an Integer object
-
getExCells
Return the set of Cell objects where contents are mutually exclusive with this cell; they are in the same row or same column or same block.- Returns:
- a Set of Cell objects not including this cell.
-
getCellRow
Returns the row group of nine of this cell.- Returns:
- a CellRow object.
-
getRowNo
public int getRowNo()Returns the row number.- Returns:
- an int value.
-
getCellCol
Returns the column group of nine of this cell.- Returns:
- a CellCol object.
-
getColNo
public int getColNo()Returns the column number.- Returns:
- an int value.
-
getCellSqr
Returns the 3x3 block group of nine of this cell.- Returns:
- a cellSqr object.
-
toString
-
valueAsString
-
posAsString
-