com.carlosbcruz.engine
Class BoardAnalysis

java.lang.Object
  extended by com.carlosbcruz.engine.BoardAnalysis

public class BoardAnalysis
extends java.lang.Object

Analyze what solutions can be found a specific board.

Author:
Carlos Fernando Bella Cruz - pessoal@carlosbcruz.com

Nested Class Summary
 class BoardAnalysis.CurrentPossibility
          Indicate a possibility that was applied.
 
Constructor Summary
BoardAnalysis(Board newBoard)
          Receives a board to work on.
 
Method Summary
 BoardAnalysis.CurrentPossibility applyNextPossibility(BoardAnalysis.CurrentPossibility currentPossibility)
          Apply the next value on the possibility array of a specific position
 boolean isValid()
          Analyze if the board is a valid one.
 BoardAnalysis.CurrentPossibility setValueFromShorterPossibilitie()
          Select the row and column with shorter number of possibilities and apply the first value to the board.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoardAnalysis

public BoardAnalysis(Board newBoard)
Receives a board to work on.

Parameters:
newBoard -
Method Detail

isValid

public boolean isValid()
Analyze if the board is a valid one.


setValueFromShorterPossibilitie

public BoardAnalysis.CurrentPossibility setValueFromShorterPossibilitie()
Select the row and column with shorter number of possibilities and apply the first value to the board.


applyNextPossibility

public BoardAnalysis.CurrentPossibility applyNextPossibility(BoardAnalysis.CurrentPossibility currentPossibility)
Apply the next value on the possibility array of a specific position

Parameters:
currentPossibility - The class that indicates the previous possibility
Returns:
the possibility applied.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object