Interface Expression

All Superinterfaces:
Serializable
All Known Implementing Classes:
BaseExpression, ClassExpression, InterpretExpression, LiteralExpression

public interface Expression extends Serializable
A expression
  • Method Summary

    Modifier and Type
    Method
    Description
    Adds the specified symbol to the symbol table and returns a reference to the unique symbol.
    Execute an expression with an empty environment, returns the result.
    Execute an expression with an environment, returns the result.
    Returns the function names in the expression when using AviatorEvaluator.EVAL mode, otherwise returns an empty list.
    Returns the source file name.
    Returns this expression's all uninitialized global variable full names(contains dot) in order when using AviatorEvaluator.EVAL mode, otherwise returns an empty list.
    Returns this expression's all uninitialized global variable names in order when using AviatorEvaluator.EVAL mode, otherwise returns an empty list.
    newEnv(Object... args)
    Created a faster env map(compare variable names by reference).The arguments should be a sequence of pair invalid input: '<'String, Object>.
  • Method Details

    • execute

      Object execute(Map<String,Object> env)
      Execute an expression with an environment, returns the result.
      Parameters:
      env - Binding variable environment
      Returns:
      the result of execution
    • execute

      Object execute()
      Execute an expression with an empty environment, returns the result.
      Returns:
      the result of execution
    • getSourceFile

      String getSourceFile()
      Returns the source file name.
      Returns:
      the source file name
      Since:
      5.2.3
    • getVariableNames

      List<String> getVariableNames()
      Returns this expression's all uninitialized global variable names in order when using AviatorEvaluator.EVAL mode, otherwise returns an empty list.
      Returns:
      See Also:
    • getVariableFullNames

      List<String> getVariableFullNames()
      Returns this expression's all uninitialized global variable full names(contains dot) in order when using AviatorEvaluator.EVAL mode, otherwise returns an empty list.
      Returns:
    • newEnv

      Map<String,Object> newEnv(Object... args)
      Created a faster env map(compare variable names by reference).The arguments should be a sequence of pair invalid input: '<'String, Object>.
      Parameters:
      args -
      Returns:
      an env map
    • addSymbol

      String addSymbol(String name)
      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.
      Parameters:
      name - The symbol name.
    • getFunctionNames

      List<String> getFunctionNames()
      Returns the function names in the expression when using AviatorEvaluator.EVAL mode, otherwise returns an empty list.
      Returns:
      the function name list
      Since:
      5.4.2