org.eclipse.ocl.examples.pivot.library
Class JavaComparisonOperation

java.lang.Object
  extended by org.eclipse.ocl.examples.pivot.library.JavaComparisonOperation
All Implemented Interfaces:
CallableImplementation, Value.BinaryOperation
Direct Known Subclasses:
JavaGreaterThanOperation, JavaGreaterThanOrEqualOperation, JavaLessThanOperation, JavaLessThanOrEqualOperation

public abstract class JavaComparisonOperation
extends java.lang.Object
implements CallableImplementation, Value.BinaryOperation


Field Summary
protected  java.lang.reflect.Method method
           
 
Constructor Summary
JavaComparisonOperation(java.lang.reflect.Method method)
           
 
Method Summary
 Value evaluate(EvaluationVisitor evaluationVisitor, Value sourceValue, CallExp callExp)
           
 Value evaluate(ValueFactory valueFactory, Value leftValue, Value rightValue)
           
protected abstract  boolean evaluateComparison(java.lang.Integer result)
           
protected  Value throwInvalidValueException(java.lang.String message, java.lang.Object... bindings)
           
 org.eclipse.emf.common.util.Diagnostic validate(TypeManager typeManager, CallExp callExp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

method

protected final java.lang.reflect.Method method
Constructor Detail

JavaComparisonOperation

public JavaComparisonOperation(java.lang.reflect.Method method)
Method Detail

evaluate

public Value evaluate(EvaluationVisitor evaluationVisitor,
                      Value sourceValue,
                      CallExp callExp)
Description copied from interface: CallableImplementation

Specified by:
evaluate in interface CallableImplementation

evaluate

public Value evaluate(ValueFactory valueFactory,
                      Value leftValue,
                      Value rightValue)
               throws InvalidValueException
Specified by:
evaluate in interface Value.BinaryOperation
Throws:
InvalidValueException

evaluateComparison

protected abstract boolean evaluateComparison(java.lang.Integer result)

throwInvalidValueException

protected Value throwInvalidValueException(java.lang.String message,
                                           java.lang.Object... bindings)
                                    throws InvalidValueException
Throws:
InvalidValueException

validate

public org.eclipse.emf.common.util.Diagnostic validate(TypeManager typeManager,
                                                       CallExp callExp)
Specified by:
validate in interface CallableImplementation