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
A simulated stack used by simulation threads to store their local variables during their
execution
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd a stackframe to this stack.Add a stackframe to this stack using the given frame as parent framevoid
pushStackFrame
(SimulatedStackframe<T> copyFrame) Add a stackframe on top of this stack.void
Pop the topmost stackframe.int
size()
toString()
-
Constructor Details
-
SimulatedStack
public SimulatedStack()
-
-
Method Details
-
createAndPushNewStackFrame
Add a stackframe to this stack. The frame has no parent frame.- Returns:
- The frame added by this method
-
createAndPushNewStackFrame
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
- 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
Add a stackframe on top of this stack. The frame already exists.- Parameters:
copyFrame
- The frame to push on the stack
-
toString
-