Record Class CoverageProbeDetails

java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.data.CoverageProbeDetails
Record Components:
probeId - Unique probe identifier within the module (0-based)
type - The type of control flow point this probe covers
sourceFile - Source file path where this probe's code exists
startLine - Starting line number in source (1-based)
startColumn - Starting column number in source (1-based)
endLine - Ending line number in source (1-based)
endColumn - Ending column number in source (1-based)
functionId - ID of the function containing this probe
statementCount - Number of statements covered by this probe

public record CoverageProbeDetails(int probeId, CoverageProbeType type, String sourceFile, int startLine, int startColumn, int endLine, int endColumn, int functionId, int statementCount) extends Record
Represents details about a single coverage probe placed in the IR.

Each probe has a unique ID within its module and captures source location information for reporting. Probes are placed at control flow points during IR generation when coverage is enabled.

  • Constructor Details

    • CoverageProbeDetails

      public CoverageProbeDetails(int probeId, CoverageProbeType type, String sourceFile, int startLine, int startColumn, int endLine, int endColumn, int functionId, int statementCount)
      Creates an instance of a CoverageProbeDetails record class.
      Parameters:
      probeId - the value for the probeId record component
      type - the value for the type record component
      sourceFile - the value for the sourceFile record component
      startLine - the value for the startLine record component
      startColumn - the value for the startColumn record component
      endLine - the value for the endLine record component
      endColumn - the value for the endColumn record component
      functionId - the value for the functionId record component
      statementCount - the value for the statementCount record component
  • Method Details

    • forLine

      public static CoverageProbeDetails forLine(int probeId, CoverageProbeType type, String sourceFile, int line, int functionId)
      Create a simple probe with just line information (column defaults to 1).
    • forRange

      public static CoverageProbeDetails forRange(int probeId, CoverageProbeType type, String sourceFile, int startLine, int startColumn, int endLine, int endColumn, int functionId, int statementCount)
      Create a probe with full location information.
    • hasValidLocation

      public boolean hasValidLocation()
      Check if this probe has valid source location information.
    • locationString

      public String locationString()
      Get a compact location string for display.
    • toString

      @Nonnull public 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 the compare method from their corresponding wrapper classes.
      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.
    • probeId

      public int probeId()
      Returns the value of the probeId record component.
      Returns:
      the value of the probeId record component
    • type

      public CoverageProbeType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • sourceFile

      public String sourceFile()
      Returns the value of the sourceFile record component.
      Returns:
      the value of the sourceFile record component
    • startLine

      public int startLine()
      Returns the value of the startLine record component.
      Returns:
      the value of the startLine record component
    • startColumn

      public int startColumn()
      Returns the value of the startColumn record component.
      Returns:
      the value of the startColumn record component
    • endLine

      public int endLine()
      Returns the value of the endLine record component.
      Returns:
      the value of the endLine record component
    • endColumn

      public int endColumn()
      Returns the value of the endColumn record component.
      Returns:
      the value of the endColumn record component
    • functionId

      public int functionId()
      Returns the value of the functionId record component.
      Returns:
      the value of the functionId record component
    • statementCount

      public int statementCount()
      Returns the value of the statementCount record component.
      Returns:
      the value of the statementCount record component