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 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 a RenderStackFrame record class.
      Parameters:
      funcName - the value for the funcName record component
      encodedLocals - the value for the encodedLocals record component
      localsAttrs - the value for the localsAttrs record component
      orderedVarnames - the value for the orderedVarnames record component
      parentFrameIdList - the value for the parentFrameIdList record component
      isHighlighted - the value for the isHighlighted record component
      isZombie - the value for the isZombie record component
      isParent - the value for the isParent record component
      uniqueHash - the value for the uniqueHash record component
      frameId - the value for the frameId record component
      file - the value for the file record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • funcName

      @SerializedName("func_name") public String funcName()
      Returns the value of the funcName record component.
      Returns:
      the value of the funcName record component
    • encodedLocals

      @SerializedName("encoded_locals") public Map<String,Object> encodedLocals()
      Returns the value of the encodedLocals record component.
      Returns:
      the value of the encodedLocals record component
    • localsAttrs

      @SerializedName("locals_attrs") public Map<String,Object> localsAttrs()
      Returns the value of the localsAttrs record component.
      Returns:
      the value of the localsAttrs record component
    • orderedVarnames

      @SerializedName("ordered_varnames") public List<String> orderedVarnames()
      Returns the value of the orderedVarnames record component.
      Returns:
      the value of the orderedVarnames record component
    • parentFrameIdList

      @SerializedName("parent_frame_id_list") public List<Integer> parentFrameIdList()
      Returns the value of the parentFrameIdList record component.
      Returns:
      the value of the parentFrameIdList record component
    • isHighlighted

      @SerializedName("is_highlighted") public boolean isHighlighted()
      Returns the value of the isHighlighted record component.
      Returns:
      the value of the isHighlighted record component
    • isZombie

      @SerializedName("is_zombie") public boolean isZombie()
      Returns the value of the isZombie record component.
      Returns:
      the value of the isZombie record component
    • isParent

      @SerializedName("is_parent") public boolean isParent()
      Returns the value of the isParent record component.
      Returns:
      the value of the isParent record component
    • uniqueHash

      @SerializedName("unique_hash") public String uniqueHash()
      Returns the value of the uniqueHash record component.
      Returns:
      the value of the uniqueHash record component
    • frameId

      @SerializedName("frame_id") public int frameId()
      Returns the value of the frameId record component.
      Returns:
      the value of the frameId record component
    • file

      @SerializedName("file") public String file()
      Returns the value of the file record component.
      Returns:
      the value of the file record component