Class SimulatedStack<T>
- java.lang.Object
-
- de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<T>
-
- Type Parameters:
T
- Content-type of the stacks contents
- All Implemented Interfaces:
Serializable
public class SimulatedStack<T> extends Object implements Serializable
A simulated stack used by simulation threads to store their local variables during their execution- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimulatedStack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimulatedStackframe<T>
createAndPushNewStackFrame()
Add a stackframe to this stack.SimulatedStackframe<T>
createAndPushNewStackFrame(SimulatedStackframe<T> parent)
Add a stackframe to this stack using the given frame as parent frameSimulatedStackframe<T>
currentStackFrame()
void
pushStackFrame(SimulatedStackframe<T> copyFrame)
Add a stackframe on top of this stack.void
removeStackFrame()
Pop the topmost stackframe.int
size()
String
toString()
-
-
-
Method Detail
-
createAndPushNewStackFrame
public SimulatedStackframe<T> createAndPushNewStackFrame()
Add a stackframe to this stack. The frame has no parent frame.- Returns:
- The frame added by this method
-
createAndPushNewStackFrame
public SimulatedStackframe<T> createAndPushNewStackFrame(SimulatedStackframe<T> parent)
Add a stackframe to this stack using the given frame as parent frame- Parameters:
parent
- The parent frame of the frame to create- Returns:
- The newly created frame
-
currentStackFrame
public SimulatedStackframe<T> currentStackFrame()
- Returns:
- Topmost stackframe on this stack
-
removeStackFrame
public void removeStackFrame()
Pop the topmost stackframe. Called when exiting a scope
-
size
public int size()
- Returns:
- Size of the stack
-
pushStackFrame
public void pushStackFrame(SimulatedStackframe<T> copyFrame)
Add a stackframe on top of this stack. The frame already exists.- Parameters:
copyFrame
- The frame to push on the stack
-
-