public interface Expression
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
eval()
Evaluate the expression.
|
default Expression |
getExpression()
Return the associated expression.
|
java.lang.String |
getExpressionName()
Return the expression name.
|
Expression |
getRoot()
Return the root expression.
|
default Variable |
getVariable(java.lang.String varName)
Return a variable declared by the expression.
|
default Variable |
getVariable(java.lang.String varName,
boolean includeLocals)
Return a variable declared by the expression.
|
java.util.Map<java.lang.String,Variable> |
getVariables()
Return the variables used by this expression.
|
default java.util.Map<java.lang.String,Variable> |
getVariables(boolean includeLocals)
Return the variables used by this expression, possibly including local variables.
|
default boolean |
hasVariable(java.lang.String varName)
Return true if there is a variable with a specified name.
|
default boolean |
hasVariable(java.lang.String varName,
boolean includeLocals)
Return true if there is a variable with a specified name.
|
default Expression getExpression()
Expression getRoot()
java.lang.Object eval()
java.lang.String getExpressionName()
java.util.Map<java.lang.String,Variable> getVariables()
int c=a+b
, only "a" and "b" will be returned.default java.util.Map<java.lang.String,Variable> getVariables(boolean includeLocals)
includeLocals
- true if local variables should be includeddefault Variable getVariable(java.lang.String varName)
varName
- the variable namedefault boolean hasVariable(java.lang.String varName)
varName
- the variable namedefault Variable getVariable(java.lang.String varName, boolean includeLocals)
getVariable(java.lang.String)
.varName
- the variable nameincludeLocals
- true if local variables should be includeddefault boolean hasVariable(java.lang.String varName, boolean includeLocals)
varName
- the variable nameincludeLocals
- true if local variables should be includedCopyright © 2019-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence