Class StackContext
- java.lang.Object
-
- de.uka.ipd.sdq.simucomframework.variables.StackContext
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Context
public class StackContext extends Object implements Serializable
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SimulatedStack<Object>
stack
The stack contained in this object.
-
Constructor Summary
Constructors Constructor Description StackContext()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
evaluate(String string)
Parse and evaluate the given Stoex using the current stackframe on top of the stackObject
evaluate(String stoex, SimulatedStackframe<Object> currentFrame)
Parse and evaluate the given Stoex<T> T
evaluate(String string, Class<T> expectedType)
Parse and evaluate the given Stoexvoid
evaluateInner(SimulatedStackframe<Object> frame, String variablename)
Evaluate all EvaluationProxies starting with "variable name" and store the results in the given stack framestatic Object
evaluateStatic(String stoex)
Parse and evaluate the given Stoexstatic Object
evaluateStatic(String stoex, SimulatedStackframe<Object> currentFrame)
Parse and evaluate the given Stoexstatic Object
evaluateStatic(String stoex, SimulatedStackframe<Object> currentFrame, VariableMode mode)
Parse and evaluate the given Stoexstatic <T> T
evaluateStatic(String string, Class<T> expectedType)
Parse and evaluate the given Stoexstatic <T> T
evaluateStatic(String string, Class<T> expectedType, SimulatedStackframe<Object> frame)
Parse and evaluate the given Stoexstatic <T> T
evaluateStatic(String string, Class<T> expectedType, SimulatedStackframe<Object> frame, VariableMode mode)
Parse and evaluate the given StoexVariableMode
getEvaluationMode()
SimulatedStack<Object>
getStack()
void
setEvaluationMode(VariableMode mode)
Set the evaluation method
-
-
-
Field Detail
-
stack
protected SimulatedStack<Object> stack
The stack contained in this object. A Stack contains StackFrames
-
-
Method Detail
-
evaluate
public <T> T evaluate(String string, Class<T> expectedType)
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
public Object evaluate(String string)
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
public Object evaluate(String stoex, SimulatedStackframe<Object> currentFrame)
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)
Parse and evaluate the given Stoex- Parameters:
string
- Stoex to evaluate- Returns:
- The value of the StoEx evaluation
-
evaluateStatic
public static Object evaluateStatic(String stoex, SimulatedStackframe<Object> currentFrame)
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
public static <T> T evaluateStatic(String string, Class<T> expectedType)
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
public void evaluateInner(SimulatedStackframe<Object> frame, String variablename)
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
public SimulatedStack<Object> getStack()
- Returns:
- The current stack
-
getEvaluationMode
public VariableMode getEvaluationMode()
- Returns:
- Current evaluation mode
-
setEvaluationMode
public void setEvaluationMode(VariableMode mode)
Set the evaluation method- Parameters:
mode
- The new evaluation method to set
-
-