Interface GameSchema


public interface GameSchema
Defines the dimensions of a GameMatrix. Usually Sudokus are 9 x 9 fields and have blocks of edge with of 3. The possible numbers are 1 to 9.
Author:
Stephan Fuhrmann
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    A mask for all bits set from bit 0 to the bit $width-1.
    int
    The total number of blocks in one dimension.
    int
    The edge dimension of a NxN block.
    byte
    The valid value that is the maximum (9).
    byte
    The valid value that is the minimum (1).
    int
    The total number of fields.
    byte
    The value that is assigned to unset fields.
    int
    The size in one dimension.
    boolean
    validBitMask(int mask)
    Is the value passed in valid for a bit mask?
    boolean
    validCoords(int row, int column)
    Is the coordinate pair passed valid?
    boolean
    validValue(byte b)
    Is the value passed in valid for a field?
  • Method Details

    • getUnsetValue

      byte getUnsetValue()
      The value that is assigned to unset fields.
      Returns:
      the unset field representing value.
    • getMinimumValue

      byte getMinimumValue()
      The valid value that is the minimum (1).
      Returns:
      the minimum digit field representing value.
    • getMaximumValue

      byte getMaximumValue()
      The valid value that is the maximum (9).
      Returns:
      the maximum digit field representing value.
    • getWidth

      int getWidth()
      The size in one dimension.
      Returns:
      the size of the game matrix edge in one dimension.
    • getTotalFields

      int getTotalFields()
      The total number of fields.
      Returns:
      the total number of fields which is the width * width.
    • getBlockWidth

      int getBlockWidth()
      The edge dimension of a NxN block.
      Returns:
      the edge dimension of a block.
    • getBlockCount

      int getBlockCount()
      The total number of blocks in one dimension.
      Returns:
      the number of blocks in one dimension.
    • getBitMask

      int getBitMask()
      A mask for all bits set from bit 0 to the bit $width-1.
      Returns:
      the mask of all bits set for all valid number values except the unset value.
    • validValue

      boolean validValue(byte b)
      Is the value passed in valid for a field?
      Parameters:
      b - value to check.
      Returns:
      true if valid.
    • validCoords

      boolean validCoords(int row, int column)
      Is the coordinate pair passed valid?
      Parameters:
      row - the row index.
      column - the column index.
      Returns:
      true if valid.
    • validBitMask

      boolean validBitMask(int mask)
      Is the value passed in valid for a bit mask?
      Parameters:
      mask - bit mask to check.
      Returns:
      true if valid.