Record Class PyTutorTrace

java.lang.Object
java.lang.Record
cs1302.tracer.model.pytutor.PyTutorTrace
Record Components:
code - The original Java source code.
stdin - The input provided via standard input.
trace - The list of trace steps representing memory snapshots.
userlog - User log messages, if any.
sources - All submitted source files keyed by relative path.
entryFile - The selected entry point source path.

public record PyTutorTrace(String code, String stdin, List<TraceStep> trace, String userlog, Map<String,String> sources, String entryFile) extends Record
Represents the root OnlinePythonTutor trace output format.
  • Constructor Details

    • PyTutorTrace

      public PyTutorTrace(String code, String stdin, List<TraceStep> trace, String userlog)
      Constructs a trace and derives source metadata from the original input.
      Parameters:
      code - Original source input.
      stdin - Standard input.
      trace - Trace steps.
      userlog - User log messages.
    • PyTutorTrace

      public PyTutorTrace(String code, String stdin, List<TraceStep> trace, String userlog, SourceMetadata metadata)
      Constructs a trace using source metadata parsed once.
      Parameters:
      code - Original source input.
      stdin - Standard input.
      trace - Trace steps.
      userlog - User log messages.
      metadata - Parsed source metadata.
    • PyTutorTrace

      public PyTutorTrace(String code, String stdin, List<TraceStep> trace, String userlog, Map<String,String> sources, String entryFile)
      Creates an instance of a PyTutorTrace record class.
      Parameters:
      code - the value for the code record component
      stdin - the value for the stdin record component
      trace - the value for the trace record component
      userlog - the value for the userlog record component
      sources - the value for the sources record component
      entryFile - the value for the entryFile 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • code

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

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

      @SerializedName("trace") public List<TraceStep> trace()
      Returns the value of the trace record component.
      Returns:
      the value of the trace record component
    • userlog

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

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

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