org.eclipse.ocl.examples.library.numeric
Class AbstractNumericUnaryOperation

java.lang.Object
  extended by org.eclipse.ocl.examples.library.AbstractFeature
      extended by org.eclipse.ocl.examples.library.AbstractOperation
          extended by org.eclipse.ocl.examples.library.AbstractUnaryOperation
              extended by org.eclipse.ocl.examples.library.numeric.AbstractNumericUnaryOperation
All Implemented Interfaces:
LibraryFeature, LibraryOperation, LibraryUnaryOperation, CallableImplementation
Direct Known Subclasses:
NumericAbsOperation, NumericFloorOperation, NumericNegateOperation, NumericRoundOperation

public abstract class AbstractNumericUnaryOperation
extends AbstractUnaryOperation

AbstractNumericUnaryOperation dispatches a unary library operation to matching-type-specific call-backs.

Since:
3.1

Constructor Summary
AbstractNumericUnaryOperation()
           
 
Method Summary
 Value evaluate(ValueFactory valueFactory, Value sourceVal)
          Return the result of evaluating the operation on an argument.
protected  Value evaluateInteger(IntegerValue left)
           
protected
<T extends NumericValue>
Value
evaluateNumeric(T left)
          Return the result of evaluating the operation on left.
protected  Value evaluateReal(RealValue left)
           
protected  Value evaluateUnlimited(java.lang.Object left)
           
 
Methods inherited from class org.eclipse.ocl.examples.library.AbstractUnaryOperation
evaluate
 
Methods inherited from class org.eclipse.ocl.examples.library.AbstractOperation
evaluate, evaluateArgument, getNumArguments
 
Methods inherited from class org.eclipse.ocl.examples.library.AbstractFeature
validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.pivot.evaluation.CallableImplementation
evaluate, validate
 

Constructor Detail

AbstractNumericUnaryOperation

public AbstractNumericUnaryOperation()
Method Detail

evaluate

public Value evaluate(ValueFactory valueFactory,
                      Value sourceVal)
               throws InvalidValueException
Description copied from interface: LibraryUnaryOperation
Return the result of evaluating the operation on an argument. An invalid return may be indicated by throwing an exception returning Java null or OCL invalid.

sourceVal - the argument
Returns:
the evaluated value
Throws:
InvalidValueException

evaluateReal

protected Value evaluateReal(RealValue left)
                      throws InvalidValueException
Throws:
InvalidValueException

evaluateInteger

protected Value evaluateInteger(IntegerValue left)
                         throws InvalidValueException
Throws:
InvalidValueException

evaluateUnlimited

protected Value evaluateUnlimited(java.lang.Object left)
                           throws InvalidValueException
Throws:
InvalidValueException

evaluateNumeric

protected <T extends NumericValue> Value evaluateNumeric(T left)
                         throws InvalidValueException
Return the result of evaluating the operation on left. A null return or an exception may be used for invalid.

Throws:
InvalidValueException