jopt.csp.solution
Class IntSolution

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

public class IntSolution
extends java.lang.Object
implements VariableSolution

Solution to an integer variable


Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 int getMax()
          Retrieves maximum value of solution
 int getMin()
          Retrieves minimum value of solution
 int getValue()
          Returns the value of the solution.
 CspVariable getVariable()
          Returns variable solution is based upon
 int hashCode()
           
 boolean isBound()
          Returns true if variable is bound in solution
 void restore()
          Restores (certain) recorded information to the associated variable.
 void setMax(int max)
          Sets maximum value of solution
 void setMin(int min)
          Sets minimum value of solution
 void setValue(int val)
          Sets both the min / max value of solution to a single value
 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
 

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

getMin

public int getMin()
Retrieves minimum value of solution


getMax

public int getMax()
Retrieves maximum value of solution


setMin

public void setMin(int min)
Sets minimum value of solution


setMax

public void setMax(int max)
Sets maximum value of solution


setValue

public void setValue(int val)
Sets both the min / max value of solution to a single value


getValue

public int getValue()
Returns the value of the solution. This function will throw an exception if the variable is not already bound.


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)