Class Cell


  • public class Cell
    extends SetOfNine
    Represents a single cell in the Sudoku grid.
    • Constructor Detail

      • Cell

        public Cell()
        Constructor, leaving all references at null. You must call makeReferences to complete the object.
    • Method Detail

      • makeReferences

        public void makeReferences​(CellRow row,
                                   CellCol col,
                                   CellSqr sqr)
        Set references to all cell groups containing this cell.
        Parameters:
        row - the cell group for the row
        col - the cell group for the column
        sqr - the cell group for the square 3x3 area
      • getValue

        public Integer getValue()
        Retrieves the value.
        Returns:
        an Integer or null
      • setValue

        public void setValue​(Integer value)
        Set the cell value.
        Parameters:
        value - an Integer object
      • getExCells

        public Set<Cell> 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

        public CellRow 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

        public CellCol 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

        public CellSqr getCellSqr()
        Returns the 3x3 block group of nine of this cell.
        Returns:
        a cellSqr object.
      • valueAsString

        public String valueAsString()
      • posAsString

        public String posAsString()