Record Class ExistsPredicate

java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.ExistsPredicate
Record Components:
query - the relation tested for a row; must not be null
location - the source location of EXISTS; never null
All Implemented Interfaces:
Predicate

public record ExistsPredicate(RelNode query, SourceLocation location) extends Record implements Predicate
EXISTS (relation): true when the relation has a row, false when it has none, and never UNKNOWN. NOT EXISTS is a NotPredicate over it.

The relation may name the columns of the row being tested, qualified, as a ScalarSubqueryOperand may.

  • Constructor Details

    • ExistsPredicate

      public ExistsPredicate(RelNode query, SourceLocation location)
      Creates an instance of a ExistsPredicate record class.
      Parameters:
      query - the value for the query record component
      location - the value for the location record component
    • ExistsPredicate

      public ExistsPredicate(RelNode query)
      Convenience constructor for tests; uses SourceLocation.UNKNOWN.
  • Method Details

    • accept

      public <R> R accept(PredicateVisitor<R> visitor)
      Specified by:
      accept in interface Predicate
    • 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.
    • query

      public RelNode query()
      Returns the value of the query record component.
      Returns:
      the value of the query record component
    • location

      public SourceLocation location()
      Returns the value of the location record component.
      Specified by:
      location in interface Predicate
      Returns:
      the value of the location record component