Record Class WindowFrame.Between

java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.WindowFrame.Between
Record Components:
unit - whether offsets count rows or measure the sort key; never null
start - where the frame begins; never UNBOUNDED FOLLOWING
end - where it ends; never UNBOUNDED PRECEDING, nor before the start
All Implemented Interfaces:
WindowFrame
Enclosing interface:
WindowFrame

public static record WindowFrame.Between(WindowFrame.Unit unit, WindowFrame.Bound start, WindowFrame.Bound end) extends Record implements WindowFrame
SQL's frame clause, ROWS | RANGE BETWEEN start AND end.

In WindowFrame.Unit.ROWS an offset counts rows: 2 PRECEDING is two rows before the current one. In WindowFrame.Unit.RANGE it is measured along the single sort key: 7 PRECEDING reaches every row whose key is within seven of the current row's, and CURRENT ROW includes the current row's peers — every row with an equal key. A RANGE offset is a number for a NUMBER key or a DURATION for a date or timestamp key.

  • Constructor Details

  • Method Details

    • measuresKey

      public boolean measuresKey()
      Whether either end is an offset measured along the sort key.
    • toString

      public 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.
    • unit

      public WindowFrame.Unit unit()
      Returns the value of the unit record component.
      Returns:
      the value of the unit record component
    • start

      public WindowFrame.Bound start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • end

      public WindowFrame.Bound end()
      Returns the value of the end record component.
      Returns:
      the value of the end record component