Record Class GuardCouplingReader.GuardCoupling

java.lang.Object
java.lang.Record
org.ek9lang.compiler.symbolic.GuardCouplingReader.GuardCoupling
Record Components:
paramIndexes - the 0-based positions of the parameters referenced, ascending
fieldPaths - dotted paths referenced through a parameter (widget.colour), in first-appearance order; empty when the condition reads no field
guardText - the condition's source text, for provenance and labelling
line - the source line the innermost condition starts on, 0 when unknown
Enclosing class:
GuardCouplingReader

public static record GuardCouplingReader.GuardCoupling(List<Integer> paramIndexes, List<String> fieldPaths, String guardText, int line) extends Record
Parameters, or fields of one parameter, that a condition (and its enclosing conditions) test together, with the provenance needed to re-check it later.
  • Constructor Details

    • GuardCoupling

      public GuardCoupling(List<Integer> paramIndexes, List<String> fieldPaths, String guardText, int line)
      Creates an instance of a GuardCoupling record class.
      Parameters:
      paramIndexes - the value for the paramIndexes record component
      fieldPaths - the value for the fieldPaths record component
      guardText - the value for the guardText record component
      line - the value for the line record component
  • Method Details

    • arity

      public int arity()
      The coupling's strength over whole parameters.
    • fieldsOf

      public List<String> fieldsOf(String parameterName)
      The distinct field paths rooted at parameterName, ascending — the dimensions a FIELD-level interaction should combine. Two or more means the code tests those fields together.
    • 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 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.
    • paramIndexes

      public List<Integer> paramIndexes()
      Returns the value of the paramIndexes record component.
      Returns:
      the value of the paramIndexes record component
    • fieldPaths

      public List<String> fieldPaths()
      Returns the value of the fieldPaths record component.
      Returns:
      the value of the fieldPaths record component
    • guardText

      public String guardText()
      Returns the value of the guardText record component.
      Returns:
      the value of the guardText record component
    • line

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