org.eclipse.ocl.examples.library.numeric
Class AbstractNumericUnaryOperation
java.lang.Object
org.eclipse.ocl.examples.library.AbstractFeature
org.eclipse.ocl.examples.library.AbstractOperation
org.eclipse.ocl.examples.library.AbstractUnaryOperation
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractNumericUnaryOperation
public AbstractNumericUnaryOperation()
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