Class 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
    • 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)  
      • 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.
        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 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