at.lcm.x2c.core.environment
Class X2cEnvironment

java.lang.Object
  extended by at.lcm.x2c.core.environment.X2cEnvironment
Direct Known Subclasses:
X2cEnvironment_Scilab

public class X2cEnvironment
extends java.lang.Object

Provide access to some functionality of the environment (Matlab, Scilab, ...) in an abstract way. This call is implemented as a singleton. Use X2cEnvironment.getInstance() to get the instance. It will automatically return the correct instance for the environment (Matlab, Scilab, ...).

Author:
Martin Hochwallner

Field Summary
protected static org.apache.logging.log4j.Logger logger
           
 
Constructor Summary
protected X2cEnvironment()
           
 
Method Summary
 ExpressionEvaluationResult evaluateExpression(java.lang.String expression)
          Evaluate an Expression in the surrounding numerical environment
 ExpressionEvaluationResult evaluateExpression(java.lang.String expression, at.lcm.x2c.core.structure.MaskDataType maskParameterDataType)
          Evaluate an Expression in the surrounding numerical environment
 void evaluateExpressionDirect(java.lang.String expression)
          evaluate expression
static X2cEnvironment getInstance()
          Return the only instance of the X2cEnvironment.
 void reset()
          reset the environment Shall only be used while testing
static void setInstance_TestingOnly(X2cEnvironment environment)
          Do not use, testing only
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.logging.log4j.Logger logger
Constructor Detail

X2cEnvironment

protected X2cEnvironment()
Method Detail

getInstance

public static X2cEnvironment getInstance()
                                  throws X2cEnvironmentRuntimeException
Return the only instance of the X2cEnvironment.
It will automatically return the correct instance for the environment (Matlab, Scilab, ...).

Returns:
the only instance of the X2cEnvironment
Throws:
X2cEnvironmentRuntimeException
EvnironmentNotRecognisedException

setInstance_TestingOnly

public static void setInstance_TestingOnly(X2cEnvironment environment)
Do not use, testing only

Parameters:
environment -

evaluateExpression

public ExpressionEvaluationResult evaluateExpression(java.lang.String expression)
Evaluate an Expression in the surrounding numerical environment


evaluateExpression

public ExpressionEvaluationResult evaluateExpression(java.lang.String expression,
                                                     at.lcm.x2c.core.structure.MaskDataType maskParameterDataType)
                                              throws java.lang.Exception
Evaluate an Expression in the surrounding numerical environment

Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

evaluateExpressionDirect

public void evaluateExpressionDirect(java.lang.String expression)
evaluate expression

Parameters:
expression -

reset

public void reset()
reset the environment Shall only be used while testing



Copyright 2019 LCM. All rights reserved.