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