Module com.darkcollective.relix.ast
Package com.darkcollective.relix.ast
Record Class QuantifiedPredicate
java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.QuantifiedPredicate
- Record Components:
left- the value compared; must not be nulloperator- the comparison; must not be nullquantifier- whether some or every comparison must hold; must not be nullquery- the one-column relation compared with; must not be nulllocation- the source location of the predicate's first token; never null
- All Implemented Interfaces:
Predicate
public record QuantifiedPredicate(Operand left, ComparisonOperator operator, Quantifier quantifier, RelNode query, SourceLocation location)
extends Record
implements Predicate
A comparison with every value of a one-column relation:
x > ALL (π v (S)),
x = ANY (π v (S)). x IN (π v (S)) is = ANY, and NOT IN a
NotPredicate over it.
The comparisons are three-valued, as SQL's are. ANY is true
when one of them is true, UNKNOWN when none is but one is UNKNOWN, and false otherwise;
ALL is false when one is false, UNKNOWN when none is but one is
UNKNOWN, and true otherwise. Over no rows ANY is false and ALL true, whatever x
is.
-
Constructor Summary
ConstructorsConstructorDescriptionQuantifiedPredicate(Operand left, ComparisonOperator operator, Quantifier quantifier, RelNode query) Convenience constructor for tests; usesSourceLocation.UNKNOWN.QuantifiedPredicate(Operand left, ComparisonOperator operator, Quantifier quantifier, RelNode query, SourceLocation location) Creates an instance of aQuantifiedPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(PredicateVisitor<R> visitor) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.left()Returns the value of theleftrecord component.location()Returns the value of thelocationrecord component.operator()Returns the value of theoperatorrecord component.Returns the value of thequantifierrecord component.query()Returns the value of thequeryrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
QuantifiedPredicate
public QuantifiedPredicate(Operand left, ComparisonOperator operator, Quantifier quantifier, RelNode query, SourceLocation location) Creates an instance of aQuantifiedPredicaterecord class.- Parameters:
left- the value for theleftrecord componentoperator- the value for theoperatorrecord componentquantifier- the value for thequantifierrecord componentquery- the value for thequeryrecord componentlocation- the value for thelocationrecord component
-
QuantifiedPredicate
public QuantifiedPredicate(Operand left, ComparisonOperator operator, Quantifier quantifier, RelNode query) Convenience constructor for tests; usesSourceLocation.UNKNOWN.
-
-
Method Details
-
accept
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
left
Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
operator
Returns the value of theoperatorrecord component.- Returns:
- the value of the
operatorrecord component
-
quantifier
Returns the value of thequantifierrecord component.- Returns:
- the value of the
quantifierrecord component
-
query
Returns the value of thequeryrecord component.- Returns:
- the value of the
queryrecord component
-
location
Returns the value of thelocationrecord component.
-