lij.runtime
Class ConstraintInstance.ConstraintComparisonInstance

java.lang.Object
  extended by lij.runtime.ConstraintInstance
      extended by lij.runtime.ConstraintInstance.ConstraintComparisonInstance
Enclosing class:
ConstraintInstance

private static class ConstraintInstance.ConstraintComparisonInstance
extends ConstraintInstance

A ConstraintInstance subclass for comparison constraints.


Field Summary
 
Fields inherited from class lij.runtime.ConstraintInstance
agentInstance, constraint, interpreter
 
Constructor Summary
private ConstraintInstance.ConstraintComparisonInstance()
           
 
Method Summary
 Result.State check()
          This method needs to be implemented by any subclasses.
private  Result.State checkValues(java.io.Serializable value1, java.io.Serializable value2, ConstraintComparison.Type type)
          Compares the two specified values.
 
Methods inherited from class lij.runtime.ConstraintInstance
createConstraintInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstraintInstance.ConstraintComparisonInstance

private ConstraintInstance.ConstraintComparisonInstance()
Method Detail

check

public Result.State check()
                   throws InterpreterException
Description copied from class: ConstraintInstance
This method needs to be implemented by any subclasses. It performs the evaluation (checking) of the constraint.

Specified by:
check in class ConstraintInstance
Returns:
The result of the evaluation (TRUE, FALSE or MAYBE).
Throws:
InterpreterException

checkValues

private Result.State checkValues(java.io.Serializable value1,
                                 java.io.Serializable value2,
                                 ConstraintComparison.Type type)
                          throws InterpreterException
Compares the two specified values. This method can be used recursively, so that lists can be compared as well as singleton values.

Parameters:
value1 - The LHS value.
value2 - The RHS value.
type - The type of the comparison.
Returns:
The result of the comparison (true or false).
Throws:
InterpreterException