Class BaseExpression

    • Field Detail

      • varNames

        protected transient java.util.List<java.lang.String> varNames
      • varFullNames

        protected transient java.util.List<java.lang.String> varFullNames
      • expression

        private java.lang.String expression
      • compileEnv

        private Env compileEnv
      • funcsArgs

        private java.util.Map<java.lang.Integer,​java.util.List<FunctionArgument>> funcsArgs
      • functionNames

        private java.util.List<java.lang.String> functionNames
      • filteredFunctionNames

        private transient java.util.List<java.lang.String> filteredFunctionNames
      • sourceFile

        protected java.lang.String sourceFile
    • Method Detail

      • getSourceFile

        public java.lang.String getSourceFile()
        Description copied from interface: Expression
        Returns the source file name.
        Specified by:
        getSourceFile in interface Expression
        Returns:
        the source file name
      • setSourceFile

        protected void setSourceFile​(java.lang.String sourceFile)
      • populateNames

        private void populateNames()
      • afterPopulateFullNames

        protected void afterPopulateFullNames​(java.util.Map<java.lang.String,​VariableMeta> fullNames,
                                              java.util.Set<java.lang.String> parentVars)
      • populateFullNames

        private void populateFullNames()
      • getFullNameMetas

        public java.util.Map<java.lang.String,​VariableMeta> getFullNameMetas()
      • newEnv

        public java.util.Map<java.lang.String,​java.lang.Object> newEnv​(java.lang.Object... args)
        Description copied from interface: Expression
        Created a faster env map(compare variable names by reference).The arguments should be a sequence of pair .
        Specified by:
        newEnv in interface Expression
        Returns:
        an env map
      • executeDirectly

        public abstract java.lang.Object executeDirectly​(java.util.Map<java.lang.String,​java.lang.Object> env)
      • execute

        public java.lang.Object execute​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Description copied from interface: Expression
        Execute an expression with an environment, returns the result.
        Specified by:
        execute in interface Expression
        Parameters:
        map - Binding variable environment
        Returns:
        the result of execution
      • execute

        protected java.lang.Object execute​(java.util.Map<java.lang.String,​java.lang.Object> map,
                                           boolean checkExecutionTimeout)
      • setFuncsArgs

        protected void setFuncsArgs​(java.util.Map<java.lang.Integer,​java.util.List<FunctionArgument>> funcsArgs)
      • getCompileEnv

        public Env getCompileEnv()
      • setCompileEnv

        protected void setCompileEnv​(Env compileEnv)
      • getExpression

        public java.lang.String getExpression()
        Returns the expression string when turn on Options.TRACE_EVAL option, else returns null.
        Returns:
        expression in string.
      • setExpression

        protected void setExpression​(java.lang.String expression)
      • addSymbol

        public java.lang.String addSymbol​(java.lang.String name)
        Description copied from interface: Expression
        Adds the specified symbol to the symbol table and returns a reference to the unique symbol. If the symbol already exists, the previous symbol reference is returned instead, in order guarantee that symbol references remain unique.
        Specified by:
        addSymbol in interface Expression
        Parameters:
        name - The symbol name.
      • execute

        public java.lang.Object execute()
        Description copied from interface: Expression
        Execute an expression with an empty environment, returns the result.
        Specified by:
        execute in interface Expression
        Returns:
        the result of execution
      • getVariableFullNames

        public java.util.List<java.lang.String> getVariableFullNames()
        Description copied from interface: Expression
        Returns this expression's all uninitialized global variable full names(contains dot) in order when using AviatorEvaluator.EVAL mode, otherwise returns an empty list.
        Specified by:
        getVariableFullNames in interface Expression
        Returns:
      • getVariableNames

        public java.util.List<java.lang.String> getVariableNames()
        Description copied from interface: Expression
        Returns this expression's all uninitialized global variable names in order when using AviatorEvaluator.EVAL mode, otherwise returns an empty list.
        Specified by:
        getVariableNames in interface Expression
        Returns:
        See Also:
        AviatorEvaluator.EVAL
      • newEnv

        protected Env newEnv​(java.util.Map<java.lang.String,​java.lang.Object> map,
                             boolean direct,
                             boolean checkExecutionTimeout)
      • genTopEnv

        protected Env genTopEnv​(java.util.Map<java.lang.String,​java.lang.Object> map,
                                boolean checkExecutionTimeout)
      • getExecutionStartNs

        private long getExecutionStartNs​(boolean checkExecutionTimeout)
      • newEnv

        protected Env newEnv​(java.util.Map<java.lang.String,​java.lang.Object> map)
      • getFunctionNames

        public java.util.List<java.lang.String> getFunctionNames()
        Description copied from interface: Expression
        Returns the function names in the expression when using AviatorEvaluator.EVAL mode, otherwise returns an empty list.
        Specified by:
        getFunctionNames in interface Expression
        Returns:
        the function name list
      • populateFilteredFuncNames

        private void populateFilteredFuncNames()
      • setFunctionNames

        protected void setFunctionNames​(java.util.List<java.lang.String> functionNames)
      • setLambdaBootstraps

        protected void setLambdaBootstraps​(java.util.Map<java.lang.String,​LambdaFunctionBootstrap> lambdaBootstraps)
      • customReadObject

        public void customReadObject​(java.io.ObjectInputStream input)
                              throws java.lang.ClassNotFoundException,
                                     java.io.IOException
        Throws:
        java.lang.ClassNotFoundException
        java.io.IOException
      • customWriteObject

        public void customWriteObject​(java.io.ObjectOutputStream output)
                               throws java.io.IOException
        Throws:
        java.io.IOException