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

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.library.AbstractFeature
      extended by org.eclipse.ocl.examples.domain.library.AbstractOperation
          extended by org.eclipse.ocl.examples.domain.library.AbstractUnaryOperation
              extended by org.eclipse.ocl.examples.library.numeric.AbstractNumericUnaryOperation
All Implemented Interfaces:
LibraryFeature, LibraryOperation, LibraryUnaryOperation
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.


Constructor Summary
AbstractNumericUnaryOperation()
           
 
Method Summary
 Value evaluate(DomainEvaluator evaluator, DomainType returnType, 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.domain.library.AbstractUnaryOperation
evaluate
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.AbstractOperation
argumentsMayBeInvalid
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.AbstractFeature
getLibraryValidator, getValidator
 
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.domain.library.LibraryOperation
argumentsMayBeInvalid
 
Methods inherited from interface org.eclipse.ocl.examples.domain.library.LibraryFeature
getValidator
 

Constructor Detail

AbstractNumericUnaryOperation

public AbstractNumericUnaryOperation()
Method Detail

evaluate

public Value evaluate(DomainEvaluator evaluator,
                      DomainType returnType,
                      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.

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