jopt.csp.solution
Class BooleanSolution

java.lang.Object
  extended byjopt.csp.solution.BooleanSolution
All Implemented Interfaces:
java.lang.Cloneable, VariableSolution

public class BooleanSolution
extends java.lang.Object
implements VariableSolution

Solution to a boolean variable


Constructor Summary
BooleanSolution(CspBooleanVariable var)
          Initializes internal solution information for variable
 
Method Summary
 void clear()
          Clears the isTrue / isFalse flag and sets variable to an unbound state
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 CspVariable getVariable()
          Returns variable solution is based upon
 int hashCode()
           
 boolean isBound()
          Returns true if variable is bound in solution
 boolean isFalse()
          Returns true if boolean variable is NOT satisfied in solution
 boolean isTrue()
          Returns true if boolean variable is satisfied in solution
 void restore()
          Restores (certain) recorded information to the associated variable.
 void setFalse()
          Sets the value of this variable to false
 void setTrue()
          Sets the value of this variable to true
 void store()
          Causes variable solution to capture certain information about it's variable and store it locally so that it can be restored later.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanSolution

public BooleanSolution(CspBooleanVariable var)
Initializes internal solution information for variable

Parameters:
var - Variable to store solution information about
Method Detail

getVariable

public CspVariable getVariable()
Description copied from interface: VariableSolution
Returns variable solution is based upon

Specified by:
getVariable in interface VariableSolution

isBound

public boolean isBound()
Description copied from interface: VariableSolution
Returns true if variable is bound in solution

Specified by:
isBound in interface VariableSolution

isFalse

public boolean isFalse()
Returns true if boolean variable is NOT satisfied in solution


isTrue

public boolean isTrue()
Returns true if boolean variable is satisfied in solution


setTrue

public void setTrue()
Sets the value of this variable to true


setFalse

public void setFalse()
Sets the value of this variable to false


clear

public void clear()
Clears the isTrue / isFalse flag and sets variable to an unbound state


store

public void store()
Description copied from interface: VariableSolution
Causes variable solution to capture certain information about it's variable and store it locally so that it can be restored later. History is not kept: calling this method overwrites any previous information captured from previous calls to this method.

Specified by:
store in interface VariableSolution

restore

public void restore()
             throws PropagationFailureException
Description copied from interface: VariableSolution
Restores (certain) recorded information to the associated variable. This is the information stored when the store() was most recently called.

Specified by:
restore in interface VariableSolution
Throws:
PropagationFailureException

toString

public java.lang.String toString()

clone

public java.lang.Object clone()
Specified by:
clone in interface VariableSolution

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object obj)