Class StackContext
java.lang.Object
de.uka.ipd.sdq.simucomframework.variables.StackContext
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Context
StackContext is the parent of all contexts. Simulated threads carry their context with them
containing their stack, their resource environment, etc. This is the stack part of the story
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SimulatedStack<Object>The stack contained in this object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionParse and evaluate the given Stoex using the current stackframe on top of the stackevaluate(String stoex, SimulatedStackframe<Object> currentFrame) Parse and evaluate the given Stoex<T> TParse and evaluate the given StoexvoidevaluateInner(SimulatedStackframe<Object> frame, String variablename) Evaluate all EvaluationProxies starting with "variable name" and store the results in the given stack framestatic ObjectevaluateStatic(String stoex) Parse and evaluate the given Stoexstatic ObjectevaluateStatic(String stoex, SimulatedStackframe<Object> currentFrame) Parse and evaluate the given Stoexstatic ObjectevaluateStatic(String stoex, SimulatedStackframe<Object> currentFrame, VariableMode mode) Parse and evaluate the given Stoexstatic <T> TevaluateStatic(String string, Class<T> expectedType) Parse and evaluate the given Stoexstatic <T> TevaluateStatic(String string, Class<T> expectedType, SimulatedStackframe<Object> frame) Parse and evaluate the given Stoexstatic <T> TevaluateStatic(String string, Class<T> expectedType, SimulatedStackframe<Object> frame, VariableMode mode) Parse and evaluate the given StoexgetStack()voidSet the evaluation method
-
Field Details
-
stack
The stack contained in this object. A Stack contains StackFrames
-
-
Constructor Details
-
StackContext
public StackContext()
-
-
Method Details
-
evaluate
Parse and evaluate the given Stoex- Parameters:
string- Stoex to evaluateexpectedType- Type expected by the evaluation. It tries to case the type when needed. If the type cannot be case, an evaluation exception is thrown- Returns:
- The value of the StoEx evaluation
-
evaluate
Parse and evaluate the given Stoex using the current stackframe on top of the stack- Parameters:
string- Stoex to evaluate- Returns:
- The value of the StoEx evaluation
-
evaluate
Parse and evaluate the given Stoex- Parameters:
string- Stoex to evaluatecurrentFrame- The Stackframe under which the evaluation is performed- Returns:
- The value of the StoEx evaluation
-
evaluateStatic
Parse and evaluate the given Stoex- Parameters:
string- Stoex to evaluate- Returns:
- The value of the StoEx evaluation
-
evaluateStatic
Parse and evaluate the given Stoex- Parameters:
string- Stoex to evaluatecurrentFrame- The Stackframe under which the evaluation is performed- Returns:
- The value of the StoEx evaluation
-
evaluateStatic
public static Object evaluateStatic(String stoex, SimulatedStackframe<Object> currentFrame, VariableMode mode) Parse and evaluate the given Stoex- Parameters:
string- Stoex to evaluatecurrentFrame- The Stackframe under which the evaluation is performedmode- Evaluation mode to use- Returns:
- The value of the StoEx evaluation
-
evaluateStatic
Parse and evaluate the given Stoex- Parameters:
string- Stoex to evaluateexpectedType- Type expected by the evaluation. It tries to case the type when needed. If the type cannot be case, an evaluation exception is thrown- Returns:
- The value of the StoEx evaluation
-
evaluateStatic
public static <T> T evaluateStatic(String string, Class<T> expectedType, SimulatedStackframe<Object> frame) Parse and evaluate the given Stoex- Parameters:
string- Stoex to evaluateexpectedType- Type expected by the evaluation. It tries to case the type when needed. If the type cannot be case, an evaluation exception is thrownframe- Stackframe to be used in the evaluation- Returns:
- The value of the StoEx evaluation
-
evaluateStatic
public static <T> T evaluateStatic(String string, Class<T> expectedType, SimulatedStackframe<Object> frame, VariableMode mode) Parse and evaluate the given Stoex- Parameters:
string- Stoex to evaluateexpectedType- Type expected by the evaluation. It tries to case the type when needed. If the type cannot be case, an evaluation exception is thrownframe- Stackframe to be used in the evaluationmode- Evaluation mode to use- Returns:
- The value of the StoEx evaluation
-
evaluateInner
Evaluate all EvaluationProxies starting with "variable name" and store the results in the given stack frame- Parameters:
frame- The frame which stores the evaluated proxy resultsvariablename-
-
getStack
- Returns:
- The current stack
-
getEvaluationMode
- Returns:
- Current evaluation mode
-
setEvaluationMode
Set the evaluation method- Parameters:
mode- The new evaluation method to set
-