Class AbstractEval

    • Field Detail

      • jep

        protected transient Jep jep
      • functionHash

        protected final java.util.Map<java.lang.String,​java.lang.Short> functionHash
        HashMap for function name lookup. Can't be static for cases when a function is renamed.
      • customFunctionCommands

        protected java.util.List<PostfixMathCommandI> customFunctionCommands
        List of additional PFMC's needed for evaluation. Most function like sin are hard coded so don't appear here.
      • ls

        protected static final java.lang.String ls
    • Constructor Detail

      • AbstractEval

        public AbstractEval​(Jep jep)
      • AbstractEval

        protected AbstractEval()
    • Method Detail

      • getUserFunction

        protected short getUserFunction​(java.lang.String name,
                                        PostfixMathCommandI pfmc)
      • getFunction

        public java.lang.String getFunction​(int ref)
        Returns the name of the function with a given reference number.
        Parameters:
        ref - reference number, one of those in RpConstants or
        Returns:
        the name of the function
      • staticGetFunction

        public static java.lang.String staticGetFunction​(int ref)
        A static version of the function to retrieve names of functions. As this is static names may not reflect names changed by chargeFunctionName(String, String).
        Parameters:
        ref - reference number, one of those in RpConstants
        Returns:
      • getConstantValue

        protected abstract java.lang.Object getConstantValue​(short ref)
      • chargeFunctionName

        public void chargeFunctionName​(java.lang.String oldname,
                                       java.lang.String newname)
                                throws JepException
        Changes the name of the standard set functions used. The standard names are "sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, abs, exp, log, ln, sqrt, sec, cosec, cot, atan2, if" which are implemented internally.
        Parameters:
        oldname - name from list
        newname - replacement name
        Throws:
        JepException - if oldname is not found