Class AbstractBinaryArithmeticOperator

java.lang.Object
org.projog.core.math.AbstractArithmeticOperator
org.projog.core.math.AbstractBinaryArithmeticOperator
All Implemented Interfaces:
KnowledgeBaseConsumer, ArithmeticOperator, PreprocessableArithmeticOperator
Direct Known Subclasses:
Add, Multiply, Subtract

public abstract class AbstractBinaryArithmeticOperator extends AbstractArithmeticOperator
A template for ArithmeticOperators that accept two arguments.
  • Constructor Details

    • AbstractBinaryArithmeticOperator

      public AbstractBinaryArithmeticOperator()
  • Method Details

    • calculate

      public final Numeric calculate(Numeric n1, Numeric n2)
      Overrides:
      calculate in class AbstractArithmeticOperator
    • 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