Record Class ClassLineTable

java.lang.Object
java.lang.Record
org.ek9lang.compiler.backend.jvm.debug.ClassLineTable

public record ClassLineTable(String sourceFile, NavigableSet<Integer> lines) extends Record
The debug-time reader of one class's EK9 source lines: the source it was compiled from (SourceFile, the .ek9 name) and every line any of its methods has code on (LineNumberTable). The EK9 SMAP is an identity line map, so those are EK9 lines - exactly the lines a breakpoint can bind to, known before the class is loaded. Read from the bytes, like MethodKindIndex, because a debugger asking JDI only learns a class's lines once the debuggee loads it.
  • Constructor Details

    • ClassLineTable

      public ClassLineTable(String sourceFile, NavigableSet<Integer> lines)
      Creates an instance of a ClassLineTable record class.
      Parameters:
      sourceFile - the value for the sourceFile record component
      lines - the value for the lines record component
  • Method Details

    • fromClassBytes

      public static ClassLineTable fromClassBytes(byte[] classBytes)
      Read classBytes; the source is empty when the class records none.
    • 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.
    • sourceFile

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

      public NavigableSet<Integer> lines()
      Returns the value of the lines record component.
      Returns:
      the value of the lines record component