Record Class Trace

java.lang.Object
java.lang.Record
cs1302.tracer.model.modern.Trace
Record Components:
code - The original Java source code (or delimited multi-file stream).
format - The trace format identifier ("modern").
stdin - The standard input provided to the program.
steps - The sequential list of trace steps.
breakpoints - Optional mapping of breakpoint line numbers to steps when tracing specific breakpoints.
sources - All submitted source files keyed by relative path.
entryFile - The selected entry point source path.

public record Trace(String code, String format, String stdin, List<Step> steps, Map<Integer,Object> breakpoints, Map<String,String> sources, String entryFile) extends Record
Root output model for the modern trace format.
  • Constructor Details

    • Trace

      public Trace(String code, String format, String stdin, List<Step> steps, Map<Integer,Object> breakpoints)
      Constructs a trace and derives its source metadata from the original input.
      Parameters:
      code - Original source input.
      format - Format identifier.
      stdin - Standard input.
      steps - Sequential steps, or null for breakpoint output.
      breakpoints - Breakpoint output, or null for sequential output.
    • Trace

      public Trace(String code, String stdin, List<Step> steps)
      Constructs a full sequential trace with stdin.
      Parameters:
      code - The source code.
      stdin - The standard input.
      steps - The trace steps.
    • Trace

      public Trace(String code, String stdin, Map<Integer,Object> breakpoints)
      Constructs a breakpoint-mapped trace with stdin.
      Parameters:
      code - The source code.
      stdin - The standard input.
      breakpoints - The breakpoints map.
    • Trace

      public Trace(String code, List<Step> steps)
      Constructs a full sequential trace defaulting to empty stdin.
      Parameters:
      code - The source code.
      steps - The trace steps.
    • Trace

      public Trace(String code, Map<Integer,Object> breakpoints)
      Constructs a breakpoint-mapped trace defaulting to empty stdin.
      Parameters:
      code - The source code.
      breakpoints - The breakpoints map.
    • Trace

      public Trace(String code, String format, String stdin, List<Step> steps, Map<Integer,Object> breakpoints, Map<String,String> sources, String entryFile)
      Creates an instance of a Trace record class.
      Parameters:
      code - the value for the code record component
      format - the value for the format record component
      stdin - the value for the stdin record component
      steps - the value for the steps record component
      breakpoints - the value for the breakpoints 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
    • format

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

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

      @SerializedName("steps") public List<Step> steps()
      Returns the value of the steps record component.
      Returns:
      the value of the steps record component
    • breakpoints

      @SerializedName("breakpoints") public Map<Integer,Object> breakpoints()
      Returns the value of the breakpoints record component.
      Returns:
      the value of the breakpoints 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