Package com.googlecode.aviator
Interface Expression
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
BaseExpression,ClassExpression,InterpretExpression,LiteralExpression
public interface Expression extends java.io.SerializableA expression
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringaddSymbol(java.lang.String name)Adds the specified symbol to the symbol table and returns a reference to the unique symbol.java.lang.Objectexecute()Execute an expression with an empty environment, returns the result.java.lang.Objectexecute(java.util.Map<java.lang.String,java.lang.Object> env)Execute an expression with an environment, returns the result.java.util.List<java.lang.String>getFunctionNames()Returns the function names in the expression when using AviatorEvaluator.EVAL mode, otherwise returns an empty list.java.lang.StringgetSourceFile()Returns the source file name.java.util.List<java.lang.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.java.util.List<java.lang.String>getVariableNames()Returns this expression's all uninitialized global variable names in order when using AviatorEvaluator.EVAL mode, otherwise returns an empty list.java.util.Map<java.lang.String,java.lang.Object>newEnv(java.lang.Object... args)Created a faster env map(compare variable names by reference).The arguments should be a sequence of pair.
-
-
-
Method Detail
-
execute
java.lang.Object execute(java.util.Map<java.lang.String,java.lang.Object> env)
Execute an expression with an environment, returns the result.- Parameters:
env- Binding variable environment- Returns:
- the result of execution
-
execute
java.lang.Object execute()
Execute an expression with an empty environment, returns the result.- Returns:
- the result of execution
-
getSourceFile
java.lang.String getSourceFile()
Returns the source file name.- Returns:
- the source file name
- Since:
- 5.2.3
-
getVariableNames
java.util.List<java.lang.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:
AviatorEvaluator.EVAL
-
getVariableFullNames
java.util.List<java.lang.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
java.util.Map<java.lang.String,java.lang.Object> newEnv(java.lang.Object... args)
Created a faster env map(compare variable names by reference).The arguments should be a sequence of pair. - Parameters:
args-- Returns:
- an env map
-
addSymbol
java.lang.String addSymbol(java.lang.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
java.util.List<java.lang.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
-
-