Package openllet.core.rules.builtins
Class FunctionApplicationVisitor
- java.lang.Object
-
- openllet.core.rules.builtins.FunctionApplicationVisitor
-
- All Implemented Interfaces:
NumericVisitor
public class FunctionApplicationVisitor extends java.lang.Object implements NumericVisitor
Title: Function Application Visitor
Description: Visitor to apply numeric functions.
Copyright: Copyright (c) 2008
Company: Clark & Parsia, LLC.
- Author:
- Ron Alford
-
-
Constructor Summary
Constructors Constructor Description FunctionApplicationVisitor(NumericFunction function)
FunctionApplicationVisitor(NumericFunction function, java.lang.Number expected)
Takes a function and an optionally null _expected value to compare against the function result.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Number
getResult()
void
visit(java.lang.Double[] args)
void
visit(java.lang.Float[] args)
void
visit(java.math.BigDecimal[] args)
void
visit(java.math.BigInteger[] args)
-
-
-
Constructor Detail
-
FunctionApplicationVisitor
public FunctionApplicationVisitor(NumericFunction function)
-
FunctionApplicationVisitor
public FunctionApplicationVisitor(NumericFunction function, java.lang.Number expected)
Takes a function and an optionally null _expected value to compare against the function result. If the _expected value is not null, the result and value will be promoted to the same type and checked for equality.- Parameters:
function
-expected
-
-
-
Method Detail
-
getResult
public java.lang.Number getResult()
- Returns:
- the result of the function application. If the application was a failure, the result will be null. If the _expected value was non-null and matched the result once both were promoted, the result will be the _expected value (unpromoted).
-
visit
public void visit(java.math.BigDecimal[] args)
- Specified by:
visit
in interfaceNumericVisitor
-
visit
public void visit(java.math.BigInteger[] args)
- Specified by:
visit
in interfaceNumericVisitor
-
visit
public void visit(java.lang.Double[] args)
- Specified by:
visit
in interfaceNumericVisitor
-
visit
public void visit(java.lang.Float[] args)
- Specified by:
visit
in interfaceNumericVisitor
-
-