Record Class ScriptComments.StatementComments

java.lang.Object
java.lang.Record
com.darkcollective.relix.lang.ast.ScriptComments.StatementComments
Record Components:
blankLineBefore - whether a blank line separated this statement, with the comments before it, from what came before
before - comments on the lines before the statement, after the one before it
inside - comments between the statement's first token and its ;, such as a comment inside its algebra
after - comments after its ;, on the same line
Enclosing class:
ScriptComments

public static record ScriptComments.StatementComments(boolean blankLineBefore, List<Comment> before, List<Comment> inside, List<Comment> after) extends Record
The comments placed by one statement, and whether a blank line came before it.
Since:
1.0
  • Field Details

  • Constructor Details

    • StatementComments

      public StatementComments(boolean blankLineBefore, List<Comment> before, List<Comment> inside, List<Comment> after)
      Checks and copies every component.
      Since:
      1.0
  • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • blankLineBefore

      public boolean blankLineBefore()
      Returns the value of the blankLineBefore record component.
      Returns:
      the value of the blankLineBefore record component
    • before

      public List<Comment> before()
      Returns the value of the before record component.
      Returns:
      the value of the before record component
    • inside

      public List<Comment> inside()
      Returns the value of the inside record component.
      Returns:
      the value of the inside record component
    • after

      public List<Comment> after()
      Returns the value of the after record component.
      Returns:
      the value of the after record component