org.deri.iris.builtins.numeric
Class NumericIntegerDivideBuiltin
java.lang.Object
org.deri.iris.builtins.AbstractBuiltin
org.deri.iris.builtins.ArithmeticBuiltin
org.deri.iris.builtins.DivideBuiltin
org.deri.iris.builtins.numeric.NumericIntegerDivideBuiltin
- All Implemented Interfaces:
- Comparable<IAtom>, IAtom, IBuiltinAtom
public class NumericIntegerDivideBuiltin
- extends DivideBuiltin
Represents a integer divide operation, i.e. divides the first argument by the
second, and returns the integer obtained by truncating the fractional part of
the result. At the evaluation time there must only be one variable left for
computation, otherwise an exception will be thrown.
- Author:
- Adrian Marte
|
Method Summary |
protected ITerm |
computeMissingTerm(int missingTermIndex,
ITerm[] terms)
Compute the missing term when the other two are known. |
NumericIntegerDivideBuiltin
public NumericIntegerDivideBuiltin(ITerm... terms)
- Constructs a builtin. Three terms must be passed to the constructor,
otherwise an exception will be thrown.
- Parameters:
terms - The terms.
- Throws:
NullPointerException - If one of the terms is null.
IllegalArgumentException - If the number of terms submitted is not
3.
NullPointerException - If t is null.
computeMissingTerm
protected ITerm computeMissingTerm(int missingTermIndex,
ITerm[] terms)
throws EvaluationException
- Description copied from class:
ArithmeticBuiltin
- Compute the missing term when the other two are known.
- Overrides:
computeMissingTerm in class DivideBuiltin
terms - The collection of all terms.
- Returns:
- The computed value.
- Throws:
EvaluationException