Record Class BucketTracker

java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.generator.BucketTracker
Record Components:
variable - the pre-loop variable holding the tracker instance
helperType - the Ek9 runtime helper backing it (Ek9Group / Ek9Split)
producesType - the collection type each completed bucket is emitted as. Its name is DERIVED here rather than carried alongside - the two used to travel as separate parameters that could in principle disagree

record BucketTracker(String variable, String helperType, IAggregateSymbol producesType) extends Record
The runtime tracker a bucketing stage accumulates into, and what it hands downstream.

group and split run the identical emission algorithm and differ only in which Ek9 helper they track with and how their boundary is decided, so these three values are exactly what varies between them.

  • Constructor Details

    • BucketTracker

      BucketTracker(String variable, String helperType, IAggregateSymbol producesType)
      Creates an instance of a BucketTracker record class.
      Parameters:
      variable - the value for the variable record component
      helperType - the value for the helperType record component
      producesType - the value for the producesType record component
  • Method Details

    • producesTypeName

      String producesTypeName()
    • 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.
    • variable

      public String variable()
      Returns the value of the variable record component.
      Returns:
      the value of the variable record component
    • helperType

      public String helperType()
      Returns the value of the helperType record component.
      Returns:
      the value of the helperType record component
    • producesType

      public IAggregateSymbol producesType()
      Returns the value of the producesType record component.
      Returns:
      the value of the producesType record component