at.lcm.x2c.core
Class StaticParamIdExpr

java.lang.Object
  extended by at.lcm.x2c.core.StaticParamIdExpr

public class StaticParamIdExpr
extends java.lang.Object

Static Parameter ID expression and value.
Provides an evaluation method which resolves an expression in the resp. environment into its value.
The evaluation features depend on the underlying environment.

Author:
Markus Aigner

Field Summary
static java.lang.String TAG
           
 
Constructor Summary
StaticParamIdExpr(int value)
          Creates new StaticParamIdExpr using a value-only configuration
The evaluation will always succeed because the the value is taken directly.
StaticParamIdExpr(int value, java.lang.String expression)
          Creates new StaticParamIdExpr using an expression and default value.
StaticParamIdExpr(java.lang.String expression)
          Creates new StaticParamIdExpr using an expression.
 
Method Summary
 void eval()
          Evaluates expression in the used environment (e.g.
 java.lang.String getExpression()
          Returns the expression.
 java.util.ArrayList<java.lang.String> getFields()
          Returns elements as String list.
 int getValue()
          Returns the value.
 boolean hasExpression()
          Returns expression usage.
 boolean isValid()
          Returns the last evaluation result state.
 void setExpression(java.lang.String expression)
          Sets a new expression.
 void setValue(int value)
          Sets new value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAG

public static final java.lang.String TAG
See Also:
Constant Field Values
Constructor Detail

StaticParamIdExpr

public StaticParamIdExpr(int value,
                         java.lang.String expression)
Creates new StaticParamIdExpr using an expression and default value.

Parameters:
value - Value
expression - Expression

StaticParamIdExpr

public StaticParamIdExpr(int value)
Creates new StaticParamIdExpr using a value-only configuration
The evaluation will always succeed because the the value is taken directly.

Parameters:
value - Value

StaticParamIdExpr

public StaticParamIdExpr(java.lang.String expression)
Creates new StaticParamIdExpr using an expression.

Parameters:
expression - Expression
Method Detail

getFields

public java.util.ArrayList<java.lang.String> getFields()
Returns elements as String list.
A non-existing expression is added as empty String.

Returns:
Element list

getValue

public int getValue()
Returns the value.

Returns:
Value

setValue

public void setValue(int value)
Sets new value.

Parameters:
value - Value

getExpression

public java.lang.String getExpression()
Returns the expression.

Returns:
Expression

setExpression

public void setExpression(java.lang.String expression)
Sets a new expression.

Parameters:
expression - Expression

eval

public void eval()
          throws EvaluationException
Evaluates expression in the used environment (e.g. Matlab, Scilab etc.).

Throws:
EvaluationException - Error during expression evaluation (e.g. invalid variable name, syntax error etc.)

isValid

public boolean isValid()
Returns the last evaluation result state.

Returns:
true of evaluation succeeded otherwise false

hasExpression

public boolean hasExpression()
Returns expression usage.

Returns:
true if expression is used otherwise false

toString

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


Copyright 2019 LCM. All rights reserved.