Package cs1302.tracer.model.pytutor
Record Class RenderStackFrame
java.lang.Object
java.lang.Record
cs1302.tracer.model.pytutor.RenderStackFrame
- Record Components:
funcName- Formatted function name with line (e.g. "main:4").encodedLocals- Local variables mapped to their serialized values.localsAttrs- Type attributes for local variables.orderedVarnames- Ordered list of variable names in the frame.parentFrameIdList- List of parent frame IDs (empty for standard frames).isHighlighted- True if this is the currently executing frame.isZombie- True if the frame is a zombie/retained frame.isParent- True if this frame acts as a parent for inner frames.uniqueHash- Unique string identifier for the frame.frameId- Numeric identifier for the frame.file- The optional relative source file path for multi-file programs.
public record RenderStackFrame(String funcName, Map<String,Object> encodedLocals, Map<String,Object> localsAttrs, List<String> orderedVarnames, List<Integer> parentFrameIdList, boolean isHighlighted, boolean isZombie, boolean isParent, String uniqueHash, int frameId, String file)
extends Record
Represents a stack frame to be rendered by OnlinePythonTutor.
-
Constructor Summary
ConstructorsConstructorDescriptionRenderStackFrame(String funcName, Map<String, Object> encodedLocals, Map<String, Object> localsAttrs, List<String> orderedVarnames, List<Integer> parentFrameIdList, boolean isHighlighted, boolean isZombie, boolean isParent, String uniqueHash, int frameId) Constructs a single-file render stack frame without a file path.RenderStackFrame(String funcName, Map<String, Object> encodedLocals, Map<String, Object> localsAttrs, List<String> orderedVarnames, List<Integer> parentFrameIdList, boolean isHighlighted, boolean isZombie, boolean isParent, String uniqueHash, int frameId, String file) Creates an instance of aRenderStackFramerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theencodedLocalsrecord component.final booleanIndicates whether some other object is "equal to" this one.file()Returns the value of thefilerecord component.intframeId()Returns the value of theframeIdrecord component.funcName()Returns the value of thefuncNamerecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisHighlightedrecord component.booleanisParent()Returns the value of theisParentrecord component.booleanisZombie()Returns the value of theisZombierecord component.Returns the value of thelocalsAttrsrecord component.Returns the value of theorderedVarnamesrecord component.Returns the value of theparentFrameIdListrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theuniqueHashrecord component.
-
Constructor Details
-
RenderStackFrame
public RenderStackFrame(String funcName, Map<String, Object> encodedLocals, Map<String, Object> localsAttrs, List<String> orderedVarnames, List<Integer> parentFrameIdList, boolean isHighlighted, boolean isZombie, boolean isParent, String uniqueHash, int frameId) Constructs a single-file render stack frame without a file path.- Parameters:
funcName- The function name.encodedLocals- The local variables.localsAttrs- The local variable attributes.orderedVarnames- The ordered variable names.parentFrameIdList- The parent frame ID list.isHighlighted- True if highlighted.isZombie- True if zombie.isParent- True if parent.uniqueHash- The unique frame hash.frameId- The frame ID.
-
RenderStackFrame
public RenderStackFrame(String funcName, Map<String, Object> encodedLocals, Map<String, Object> localsAttrs, List<String> orderedVarnames, List<Integer> parentFrameIdList, boolean isHighlighted, boolean isZombie, boolean isParent, String uniqueHash, int frameId, String file) Creates an instance of aRenderStackFramerecord class.- Parameters:
funcName- the value for thefuncNamerecord componentencodedLocals- the value for theencodedLocalsrecord componentlocalsAttrs- the value for thelocalsAttrsrecord componentorderedVarnames- the value for theorderedVarnamesrecord componentparentFrameIdList- the value for theparentFrameIdListrecord componentisHighlighted- the value for theisHighlightedrecord componentisZombie- the value for theisZombierecord componentisParent- the value for theisParentrecord componentuniqueHash- the value for theuniqueHashrecord componentframeId- the value for theframeIdrecord componentfile- the value for thefilerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
funcName
Returns the value of thefuncNamerecord component.- Returns:
- the value of the
funcNamerecord component
-
encodedLocals
Returns the value of theencodedLocalsrecord component.- Returns:
- the value of the
encodedLocalsrecord component
-
localsAttrs
Returns the value of thelocalsAttrsrecord component.- Returns:
- the value of the
localsAttrsrecord component
-
orderedVarnames
Returns the value of theorderedVarnamesrecord component.- Returns:
- the value of the
orderedVarnamesrecord component
-
parentFrameIdList
Returns the value of theparentFrameIdListrecord component.- Returns:
- the value of the
parentFrameIdListrecord component
-
isHighlighted
@SerializedName("is_highlighted") public boolean isHighlighted()Returns the value of theisHighlightedrecord component.- Returns:
- the value of the
isHighlightedrecord component
-
isZombie
@SerializedName("is_zombie") public boolean isZombie()Returns the value of theisZombierecord component.- Returns:
- the value of the
isZombierecord component
-
isParent
@SerializedName("is_parent") public boolean isParent()Returns the value of theisParentrecord component.- Returns:
- the value of the
isParentrecord component
-
uniqueHash
Returns the value of theuniqueHashrecord component.- Returns:
- the value of the
uniqueHashrecord component
-
frameId
@SerializedName("frame_id") public int frameId()Returns the value of theframeIdrecord component.- Returns:
- the value of the
frameIdrecord component
-
file
Returns the value of thefilerecord component.- Returns:
- the value of the
filerecord component
-