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 Details

    • createExpression

      void createExpression(String expression) throws Exception
      Method to create an expression in the engine, throws an exception if the expression cannot be parsed
      Parameters:
      expression -
      Throws:
      Exception
    • evaluate

      <T> T evaluate() throws Exception
      Evaluates the expression set in the engine, throws exception if cannot evaluate, returns answer as object
      Returns:
      Object
      Throws:
      Exception
    • addExpressionEngineListener

      void addExpressionEngineListener(IExpressionEngineListener listener)
      Adds a listener for expression evaluated with event (calculation performed in separate thread)
      Parameters:
      listener -
    • removeExpressionEngineListener

      void removeExpressionEngineListener(IExpressionEngineListener listener)
      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

      Map<String,Object> getFunctions()
      Get all functions currently in the expression engine
    • setFunctions

      void setFunctions(Map<String,Object> functions)
      Set all functions currently in the expression engine
      Parameters:
      functions -
    • setLoadedVariables

      void setLoadedVariables(Map<String,Object> variables)
      Set all variables currently in the expression engine
      Parameters:
      variables -
    • getLoadedVariable

      Object getLoadedVariable(String name)
      get named variable from engine
      Parameters:
      name -
    • addLoadedVariables

      void addLoadedVariables(Map<String,Object> variables)
      Adds to variables currently in the expression engine
      Parameters:
      variables -
    • addLoadedVariable

      void addLoadedVariable(String name, Object value)
      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.