Record Class VerbatimLines.Lines

java.lang.Object
java.lang.Record
org.ek9lang.compiler.formatter.VerbatimLines.Lines
Record Components:
interior - lines after the first of a multi-line comment or String: never re-indented or re-spaced.
withinStrings - every line a multi-line String touches, its opening line included: never re-spaced, split or joined.
Enclosing class:
VerbatimLines

static record VerbatimLines.Lines(Set<Integer> interior, Set<Integer> withinStrings) extends Record
The lines to leave alone.
  • Constructor Details

    • Lines

      Lines(Set<Integer> interior, Set<Integer> withinStrings)
      Creates an instance of a Lines record class.
      Parameters:
      interior - the value for the interior record component
      withinStrings - the value for the withinStrings record component
  • Method Details

    • touchesString

      boolean touchesString(int first, int last)
      True when any line from first to last (inclusive) is within a multi-line String.
    • 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.
    • interior

      public Set<Integer> interior()
      Returns the value of the interior record component.
      Returns:
      the value of the interior record component
    • withinStrings

      public Set<Integer> withinStrings()
      Returns the value of the withinStrings record component.
      Returns:
      the value of the withinStrings record component