Record Class Step

java.lang.Object
java.lang.Record
cs1302.tracer.model.modern.Step
Record Components:
step - The sequential step index (1-based).
line - The current line number.
file - The relative source file path (if multi-file).
event - The event type (e.g. "step_line").
method - The currently executing method name.
callStack - The call stack frames (bottommost frame at index 0).
statics - The loaded static/global variables.
heap - The heap objects map keyed by unique reference ID.
stdout - Standard output captured up to this step.
stderr - Standard error captured up to this step.
stdinConsumed - Standard input consumed up to this step.
stdinOffset - Character offset reached in standard input up to this step.
threads - Application threads, or null for legacy traces.
triggeringThreadId - Event thread identity, or null for legacy traces.

public record Step(int step, long line, String file, String event, String method, List<StackFrame> callStack, List<Variable> statics, Map<String,HeapObject> heap, String stdout, String stderr, String stdinConsumed, int stdinOffset, List<Step.ThreadState> threads, Long triggeringThreadId) extends Record
Represents a single execution step in the modern trace format.
  • Constructor Details

    • Step

      public Step(int step, long line, String file, String event, String method, List<StackFrame> callStack, List<Variable> statics, Map<String,HeapObject> heap, String stdout, String stderr, String stdinConsumed, int stdinOffset)
      Constructs a step without thread metadata.
      Parameters:
      step - Step number.
      line - Source line.
      file - Source file.
      event - Event kind.
      method - Executing method.
      callStack - Stack frames.
      statics - Static fields.
      heap - Heap objects.
      stdout - Standard output.
      stderr - Standard error.
      stdinConsumed - Consumed input.
      stdinOffset - Input offset.
    • Step

      public Step(int step, long line, String file, String event, String method, List<StackFrame> callStack, List<Variable> statics, Map<String,HeapObject> heap, String stdout, String stderr)
      Constructs a step defaulting stdin tracking attributes.
      Parameters:
      step - The sequential step index.
      line - The current line number.
      file - The relative source file path.
      event - The event type.
      method - The executing method name.
      callStack - The call stack frames.
      statics - Static variables.
      heap - Heap objects map.
      stdout - Captured standard output.
      stderr - Captured standard error.
    • Step

      public Step(int step, long line, String file, String event, String method, List<StackFrame> callStack, List<Variable> statics, Map<String,HeapObject> heap, String stdout, String stderr, String stdinConsumed, int stdinOffset, List<Step.ThreadState> threads, Long triggeringThreadId)
      Creates an instance of a Step record class.
      Parameters:
      step - the value for the step record component
      line - the value for the line record component
      file - the value for the file record component
      event - the value for the event record component
      method - the value for the method record component
      callStack - the value for the callStack record component
      statics - the value for the statics record component
      heap - the value for the heap record component
      stdout - the value for the stdout record component
      stderr - the value for the stderr record component
      stdinConsumed - the value for the stdinConsumed record component
      stdinOffset - the value for the stdinOffset record component
      threads - the value for the threads record component
      triggeringThreadId - the value for the triggeringThreadId 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.
    • step

      @SerializedName("step") public int step()
      Returns the value of the step record component.
      Returns:
      the value of the step 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
    • event

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

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

      @SerializedName("callStack") public List<StackFrame> callStack()
      Returns the value of the callStack record component.
      Returns:
      the value of the callStack record component
    • statics

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

      @SerializedName("heap") public Map<String,HeapObject> heap()
      Returns the value of the heap record component.
      Returns:
      the value of the heap record component
    • stdout

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

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

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

      @SerializedName("stdinOffset") public int stdinOffset()
      Returns the value of the stdinOffset record component.
      Returns:
      the value of the stdinOffset record component
    • threads

      @SerializedName("threads") public List<Step.ThreadState> threads()
      Returns the value of the threads record component.
      Returns:
      the value of the threads record component
    • triggeringThreadId

      @SerializedName("triggeringThreadId") public Long triggeringThreadId()
      Returns the value of the triggeringThreadId record component.
      Returns:
      the value of the triggeringThreadId record component