Class SimulatedStackframe<T>
- java.lang.Object
-
- de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
Serializable
public class SimulatedStackframe<T> extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimulatedStackframe()
SimulatedStackframe(SimulatedStackframe<T> parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(String id, T value)
Add a value to this stackframevoid
addVariables(SimulatedStackframe<T> callResult)
Add all variables and their values in the given frame to this frameSimulatedStackframe<T>
copyFrame()
Clone this stackframeArrayList<Map.Entry<String,T>>
getContents()
T
getValue(String id)
Retrieve a value from this stackframe.String
toString()
-
-
-
Constructor Detail
-
SimulatedStackframe
public SimulatedStackframe(SimulatedStackframe<T> parent)
-
SimulatedStackframe
public SimulatedStackframe()
-
-
Method Detail
-
addValue
public void addValue(String id, T value)
Add a value to this stackframe- Parameters:
id
- ID of the valuevalue
- The actual value
-
getValue
public T getValue(String id) throws ValueNotInFrameException
Retrieve a value from this stackframe. If the value is not part of this stackframe the parent stackframe is queried automatically- Parameters:
id
- ID of the variable value to retrieve- Returns:
- The value of the variable with id ID.
- Throws:
ValueNotInFrameException
- Is throw if this frame and all parent frames do not contain the id ID
-
copyFrame
public SimulatedStackframe<T> copyFrame()
Clone this stackframe- Returns:
- A clone of the stackframe. The parent frames are copies as well
-
getContents
public ArrayList<Map.Entry<String,T>> getContents()
- Returns:
- All IDs and their value in the current frame. For debugging and error reporting cases
-
addVariables
public void addVariables(SimulatedStackframe<T> callResult)
Add all variables and their values in the given frame to this frame- Parameters:
callResult
- The frame whose contents will be copied into this frame
-
-