public abstract class AbstractArithmeticOperator extends Object implements PreprocessableArithmeticOperator, KnowledgeBaseConsumer
| Constructor and Description |
|---|
AbstractArithmeticOperator() |
| Modifier and Type | Method and Description |
|---|---|
protected Numeric |
calculate(Numeric n) |
protected Numeric |
calculate(Numeric n1,
Numeric n2) |
Numeric |
calculate(Term[] args)
Returns the result of the calculation using the specified arguments.
|
protected boolean |
isPure()
Indicates if this operator is pure and so can be preprocessed.
|
ArithmeticOperator |
preprocess(Term expression) |
void |
setKnowledgeBase(KnowledgeBase kb)
Provides a reference to a
KnowledgeBase. |
public final void setKnowledgeBase(KnowledgeBase kb)
KnowledgeBase.
Meaning this object will always have access to a KnowledgeBase by the time its calculate method is
invoked.
setKnowledgeBase in interface KnowledgeBaseConsumerpublic final Numeric calculate(Term[] args)
ArithmeticOperatorcalculate in interface ArithmeticOperatorargs - the arguments to use in the calculationpublic final ArithmeticOperator preprocess(Term expression)
preprocess in interface PreprocessableArithmeticOperatorprotected boolean isPure()
An operator is pure if multiple calls with identical arguments always produce the same result.
Copyright © 2024. All rights reserved.