Class SimulatedStackHelper
- java.lang.Object
-
- org.palladiosimulator.simulizar.utils.SimulatedStackHelper
-
public final class SimulatedStackHelper extends Object
A simulated stack for the pcm interpreter with some convenience methods.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.palladiosimulator.pcm.stoex.api.StoExSerialiser
STOEX_SERIALISER
-
Constructor Summary
Constructors Constructor Description SimulatedStackHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addParameterToStackFrame(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> contextStackFrame, EList<org.palladiosimulator.pcm.parameter.VariableUsage> parameter, de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> targetStackFrame)
Adds parameters to given stack frame.static de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object>
createAndPushNewStackFrame(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, EList<org.palladiosimulator.pcm.parameter.VariableUsage> parameter)
Convenience method creating new stack frame, adds it to stack and puts parameters into frame.static de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object>
createAndPushNewStackFrame(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, EList<org.palladiosimulator.pcm.parameter.VariableUsage> parameter, de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> parent)
Convenience method creating new stack frame with parent, adds it to stack and puts parameters into frame.static de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object>
createFromMap(Map<String,Object> map)
Convenience method for creating a new stack frame that contains the elements in the given map.static boolean
isInnerReference(de.uka.ipd.sdq.stoex.AbstractNamedReference reference)
Returns whether the specified reference belongs to an INNER variable characterisation.
-
-
-
Method Detail
-
addParameterToStackFrame
public static final void addParameterToStackFrame(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> contextStackFrame, EList<org.palladiosimulator.pcm.parameter.VariableUsage> parameter, de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> targetStackFrame)
Adds parameters to given stack frame.- Parameters:
parameter
- the parameter.targetStackFrame
- the stack frame.
-
isInnerReference
public static boolean isInnerReference(de.uka.ipd.sdq.stoex.AbstractNamedReference reference)
Returns whether the specified reference belongs to an INNER variable characterisation.- Parameters:
reference
- the named reference associated with a variable characterisation- Returns:
- true, if the reference's name is "INNER"; false else.
-
createAndPushNewStackFrame
public static final de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> createAndPushNewStackFrame(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, EList<org.palladiosimulator.pcm.parameter.VariableUsage> parameter)
Convenience method creating new stack frame, adds it to stack and puts parameters into frame. This method uses own stack for parameter evaluation.- Parameters:
parameter
- the parameter.- Returns:
- the created stack frame.
-
createAndPushNewStackFrame
public static final de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> createAndPushNewStackFrame(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, EList<org.palladiosimulator.pcm.parameter.VariableUsage> parameter, de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> parent)
Convenience method creating new stack frame with parent, adds it to stack and puts parameters into frame. This method uses own stack for parameter evaluation.- Parameters:
parameter
- the parameter.parent
- the parent, if null no parent will be set.- Returns:
- the created stack frame.
-
createFromMap
public static final de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> createFromMap(Map<String,Object> map)
Convenience method for creating a new stack frame that contains the elements in the given map. Does not validate the input.- Parameters:
map
- the map of entries the new stack frame is to contain- Returns:
- the created stack frame
-
-