Record Class AggregateFunction.Traits

java.lang.Object
java.lang.Record
com.inductiveautomation.historian.gateway.api.query.pipeline.AggregateFunction.Traits
Enclosing interface:
AggregateFunction<ACC>

public static record AggregateFunction.Traits(AggregateFunction.QualityPolicy quality, boolean readsWindow, boolean awaitsNext, boolean readsEdges) extends Record
What the pipeline needs to know about a fold: how it treats quality, whether AggregateFunction.open(AggregateFunction.Window) reads its window (so the pipeline seeds the key and opens a window that has a prior but no samples), whether time after a window's last sample counts only once AggregateFunction.close(ACC, AggregateFunction.PriorSample) supplies the sample after the window, and whether it reads the stored samples at its window's edges.

A fold that reads edges is gated like any other, and also: its prior is the last stored sample before the window of any quality, AggregateFunction.add(ACC, long, Object, QualityCode) also receives the samples the query's filter refuses (tell them apart by AggregateFunction.Window.admit, never by value), and AggregateFunction.close(ACC, AggregateFunction.PriorSample) receives the first stored sample after the window of any quality. On a key whose windows take no edges the pipeline treats it as a plain value fold.

  • Field Details

    • VALUE_FOLD

      public static final AggregateFunction.Traits VALUE_FOLD
      A gated fold over the samples inside the window.
    • EDGE_FOLD

      public static final AggregateFunction.Traits EDGE_FOLD
      A fold that takes the bounds at its window's edges in every window.
  • Constructor Details

    • Traits

      public Traits(AggregateFunction.QualityPolicy quality, boolean readsWindow, boolean awaitsNext)
    • Traits

      public Traits(AggregateFunction.QualityPolicy quality, boolean readsWindow, boolean awaitsNext, boolean readsEdges)
      Creates an instance of a Traits record class.
      Parameters:
      quality - the value for the quality record component
      readsWindow - the value for the readsWindow record component
      awaitsNext - the value for the awaitsNext record component
      readsEdges - the value for the readsEdges 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. 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.
    • quality

      Returns the value of the quality record component.
      Returns:
      the value of the quality record component
    • readsWindow

      public boolean readsWindow()
      Returns the value of the readsWindow record component.
      Returns:
      the value of the readsWindow record component
    • awaitsNext

      public boolean awaitsNext()
      Returns the value of the awaitsNext record component.
      Returns:
      the value of the awaitsNext record component
    • readsEdges

      public boolean readsEdges()
      Returns the value of the readsEdges record component.
      Returns:
      the value of the readsEdges record component