Module com.darkcollective.relix.ast
Package com.darkcollective.relix.ast
Record Class CollateOperand
java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.CollateOperand
- Record Components:
operand- the string being compared; must not be nullcollation- the collation's name:BINARY,NOCASEor a locale tag; must not be blanklocation- the source location of this operand; never null
- All Implemented Interfaces:
Operand
public record CollateOperand(Operand operand, String collation, SourceLocation location)
extends Record
implements Operand
A string compared under a named collation:
s COLLATE NOCASE.
The operand's value is unchanged; the collation decides how it compares with another string. It applies where a comparison is made: in a comparison, a membership or pattern test, a join condition, a sort key and a grouping key.
BINARY compares by code point, which is what every string comparison does
without a collation. NOCASE compares strings equal when they are equal
lower-cased. Any other name is a locale, such as 'en-US', which orders strings
as that language's dictionary does. Names are held as written, the two built-in ones
upper-cased; whether a name is a locale the engine has is decided at analysis.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCollateOperand(Operand operand, String collation) Convenience constructor for tests; usesSourceLocation.UNKNOWN.CollateOperand(Operand operand, String collation, SourceLocation location) Creates an instance of aCollateOperandrecord class. -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(OperandVisitor<R> visitor) Returns the value of thecollationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisLocale()Returns whether the collation is a locale rather thanBINARYorNOCASE.location()Returns the value of thelocationrecord component.operand()Returns the value of theoperandrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.darkcollective.relix.ast.Operand
prettyPrint, prettyPrint
-
Field Details
-
BINARY
Code-point order, the default.- See Also:
-
NOCASE
Equal when equal lower-cased.- See Also:
-
-
Constructor Details
-
CollateOperand
Creates an instance of aCollateOperandrecord class. -
CollateOperand
Convenience constructor for tests; usesSourceLocation.UNKNOWN.
-
-
Method Details
-
isLocale
public boolean isLocale()Returns whether the collation is a locale rather thanBINARYorNOCASE.- Returns:
- whether the collation is a locale rather than
BINARYorNOCASE
-
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). -
operand
Returns the value of theoperandrecord component.- Returns:
- the value of the
operandrecord component
-
collation
Returns the value of thecollationrecord component.- Returns:
- the value of the
collationrecord component
-
location
Returns the value of thelocationrecord component.
-