Interface IExpressionEngine
- All Known Implementing Classes:
ExpressionEngineImpl,VanillaExpressionEngine
public interface IExpressionEngine
This service can be called to save and/or load data from an hdf5 file.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener for expression evaluated with event (calculation performed in separate thread)voidaddLoadedVariable(String name, Object value) Adds single variable to variables currently in the expression enginevoidaddLoadedVariables(Map<String, Object> variables) Adds to variables currently in the expression enginevoidcreateExpression(String expression) Method to create an expression in the engine, throws an exception if the expression cannot be parsed<T> Tevaluate()Evaluates the expression set in the engine, throws exception if cannot evaluate, returns answer as objectvoidevaluateWithEvent(org.eclipse.january.IMonitor monitor) Evaluate the expression and fire an event on completion (for long calculations, or expressions on UI) Can be cancelled using the monitorGet all functions currently in the expression engineGets names of variables from the expression which can be provided as lazy datasets.getLoadedVariable(String name) get named variable from engineGets names of *all* variables from the expression.voidRemoves a listener for expression evaluated with event (calculation performed in separate thread)voidsetFunctions(Map<String, Object> functions) Set all functions currently in the expression enginevoidsetLoadedVariables(Map<String, Object> variables) Set all variables currently in the expression engine
-
Method Details
-
createExpression
Method to create an expression in the engine, throws an exception if the expression cannot be parsed- Parameters:
expression-- Throws:
Exception
-
evaluate
Evaluates the expression set in the engine, throws exception if cannot evaluate, returns answer as object- Returns:
- Object
- Throws:
Exception
-
addExpressionEngineListener
Adds a listener for expression evaluated with event (calculation performed in separate thread)- Parameters:
listener-
-
removeExpressionEngineListener
Removes a listener for expression evaluated with event (calculation performed in separate thread)- Parameters:
listener-
-
evaluateWithEvent
void evaluateWithEvent(org.eclipse.january.IMonitor monitor) Evaluate the expression and fire an event on completion (for long calculations, or expressions on UI) Can be cancelled using the monitor- Parameters:
monitor-
-
getFunctions
Get all functions currently in the expression engine -
setFunctions
Set all functions currently in the expression engine- Parameters:
functions-
-
setLoadedVariables
Set all variables currently in the expression engine- Parameters:
variables-
-
getLoadedVariable
get named variable from engine- Parameters:
name-
-
addLoadedVariables
Adds to variables currently in the expression engine- Parameters:
variables-
-
addLoadedVariable
Adds single variable to variables currently in the expression engine- Parameters:
name-value-
-
getVariableNamesFromExpression
Collection<String> getVariableNamesFromExpression()Gets names of *all* variables from the expression.The returned collection attempts to maintain the order of the variable names as they were first encountered in the expression.
-
getLazyVariableNamesFromExpression
Collection<String> getLazyVariableNamesFromExpression()Gets names of variables from the expression which can be provided as lazy datasets. The expression will then do the relavent slicing during evaluation.
-