Package org.projog.core.math
Class AbstractUnaryArithmeticOperator
- java.lang.Object
-
- org.projog.core.math.AbstractArithmeticOperator
-
- org.projog.core.math.AbstractUnaryArithmeticOperator
-
- All Implemented Interfaces:
KnowledgeBaseConsumer,ArithmeticOperator,PreprocessableArithmeticOperator
public abstract class AbstractUnaryArithmeticOperator extends AbstractArithmeticOperator
A template forArithmeticOperators that accept exactly one argument.
-
-
Constructor Summary
Constructors Constructor Description AbstractUnaryArithmeticOperator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Numericcalculate(Numeric n)protected abstract doublecalculateDouble(double n)Returns the result of evaluating an arithmetic expression using the specified argumentprotected abstract longcalculateLong(long n)Returns the result of evaluating an arithmetic expression using the specified argument-
Methods inherited from class org.projog.core.math.AbstractArithmeticOperator
calculate, calculate, isPure, preprocess, setKnowledgeBase
-
-
-
-
Method Detail
-
calculate
public final Numeric calculate(Numeric n)
- Overrides:
calculatein classAbstractArithmeticOperator
-
calculateDouble
protected abstract double calculateDouble(double n)
Returns the result of evaluating an arithmetic expression using the specified argument
-
calculateLong
protected abstract long calculateLong(long n)
Returns the result of evaluating an arithmetic expression using the specified argument
-
-