Record Class Applied

java.lang.Object
java.lang.Record
io.github.vecbricks.jegg.Applied
Record Components:
unions - the unions that merged two classes
counted - what egg's runner would count as applied

public record Applied(int unions, int counted) extends Record
What applying one match did, in the two senses a run needs. unions is the number of unions that changed the graph. counted is the number egg's runner counts as applied: the same for a rule whose right-hand side is a pattern or a function, but one per match for a right-hand side that is a multi-pattern (Applier.multi(MultiPattern)), whose egg apply_matches returns an id for every substitution whether or not a union changed anything. A run saturates only in an iteration in which nothing was counted. The left-hand side does not decide: a multi-pattern searched and a pattern applied counts unions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Applied(int unions, int counted)
    Creates an instance of a Applied record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the counted record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the unions record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Applied

      public Applied(int unions, int counted)
      Creates an instance of a Applied record class.
      Parameters:
      unions - the value for the unions record component
      counted - the value for the counted record component
  • 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. All components in this record class 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.
    • unions

      public int unions()
      Returns the value of the unions record component.
      Returns:
      the value of the unions record component
    • counted

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