Module com.darkcollective.relix.ast
Package com.darkcollective.relix.ast
Record Class ElementOfPredicate
java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.ElementOfPredicate
- Record Components:
element- the element to test; must not be nullsetExpression- the set expression to test membership in; must not be nullisNegated-truefor ∉ (not element of),falsefor ∈ (element of)location- the source location of this predicate; never null
- All Implemented Interfaces:
Predicate
public record ElementOfPredicate(Operand element, Operand setExpression, boolean isNegated, SourceLocation location)
extends Record
implements Predicate
Represents element-of predicates: element ∈ set_expression or element ∉ set_expression
Used for set membership testing (equivalent to SQL IN/NOT IN).
-
Constructor Summary
ConstructorsConstructorDescriptionElementOfPredicate(Operand element, Operand setExpression, boolean isNegated) Convenience constructor for tests; usesSourceLocation.UNKNOWN.ElementOfPredicate(Operand element, Operand setExpression, boolean isNegated, SourceLocation location) Creates an instance of aElementOfPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(PredicateVisitor<R> visitor) element()Returns the value of theelementrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisNegatedrecord component.location()Returns the value of thelocationrecord component.Returns the value of thesetExpressionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ElementOfPredicate
public ElementOfPredicate(Operand element, Operand setExpression, boolean isNegated, SourceLocation location) Creates an instance of aElementOfPredicaterecord class.- Parameters:
element- the value for theelementrecord componentsetExpression- the value for thesetExpressionrecord componentisNegated- the value for theisNegatedrecord componentlocation- the value for thelocationrecord component
-
ElementOfPredicate
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
element
Returns the value of theelementrecord component.- Returns:
- the value of the
elementrecord component
-
setExpression
Returns the value of thesetExpressionrecord component.- Returns:
- the value of the
setExpressionrecord component
-
isNegated
public boolean isNegated()Returns the value of theisNegatedrecord component.- Returns:
- the value of the
isNegatedrecord component
-
location
Returns the value of thelocationrecord component.
-