com.clarkparsia.pellet.rules.builtins
Class FunctionApplicationVisitor

java.lang.Object
  extended by com.clarkparsia.pellet.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
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
 java.lang.Number getResult()
          Returns the result of the function application.
 void visit(java.math.BigDecimal[] args)
           
 void visit(java.math.BigInteger[] args)
           
 void visit(java.lang.Double[] args)
           
 void visit(java.lang.Float[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

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 interface NumericVisitor

visit

public void visit(java.math.BigInteger[] args)
Specified by:
visit in interface NumericVisitor

visit

public void visit(java.lang.Double[] args)
Specified by:
visit in interface NumericVisitor

visit

public void visit(java.lang.Float[] args)
Specified by:
visit in interface NumericVisitor


Copyright © 2004 Evren Sirin. All Rights Reserved.