Record Class StackFrame

java.lang.Object
java.lang.Record
cs1302.tracer.model.modern.StackFrame
Record Components:
methodName - The name of the executing method.
line - The current line number in this frame.
file - The relative source file path (if multi-file).
isHighlighted - True if this is the currently active/topmost frame.
thisObject - The Reference pointing to this on the heap, or null.
locals - The ordered list of local variables in this frame.

public record StackFrame(String methodName, long line, String file, boolean isHighlighted, Reference thisObject, List<Variable> locals) extends Record
Represents a stack frame in the modern trace format.
  • Constructor Details

    • StackFrame

      public StackFrame(String methodName, long line, String file, boolean isHighlighted, Reference thisObject, List<Variable> locals)
      Creates an instance of a StackFrame record class.
      Parameters:
      methodName - the value for the methodName record component
      line - the value for the line record component
      file - the value for the file record component
      isHighlighted - the value for the isHighlighted record component
      thisObject - the value for the thisObject record component
      locals - the value for the locals 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.
    • methodName

      @SerializedName("methodName") public String methodName()
      Returns the value of the methodName record component.
      Returns:
      the value of the methodName record component
    • line

      @SerializedName("line") public long line()
      Returns the value of the line record component.
      Returns:
      the value of the line record component
    • file

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

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

      @SerializedName("this") public Reference thisObject()
      Returns the value of the thisObject record component.
      Returns:
      the value of the thisObject record component
    • locals

      @SerializedName("locals") public List<Variable> locals()
      Returns the value of the locals record component.
      Returns:
      the value of the locals record component