Package org.apache.derby.iapi.types
Class WorkHorseForCollatorDatatypes
java.lang.Object
org.apache.derby.iapi.types.WorkHorseForCollatorDatatypes
WorkHorseForCollatorDatatypes class holds on to RuleBasedCollator,
and the base SQLChar object for the collation sensitive SQLChar,
SQLVarchar, SQLLongvarchar and SQLClob. This class uses RuleBasedCollator
and SQLChar object in the collation sensitive methods to do the comparison.
The reason for encapsulating this here is that the collation version of
SQLChar, SQLVarchar, SQLLongvarchar and SQLClob do not all have to duplicate
the code for collation sensitive methods. Instead, they can simply delegate
the work to methods defined in this class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RuleBasedCollator
Use this object for collation on character datatype.private SQLChar
collatorForCharacterDatatypes will be used on this SQLChar to determine collationElementsForString. -
Constructor Summary
ConstructorsConstructorDescriptionWorkHorseForCollatorDatatypes
(RuleBasedCollator collatorForCharacterDatatypes, SQLChar stringData) -
Method Summary
Modifier and TypeMethodDescription(package private) RuleBasedCollator
Get the RuleBasedCollator which is getting used for collation sensitive methods.(package private) boolean
Check if the string consists of a single collation element.(package private) BooleanDataValue
like
(DataValueDescriptor pattern) This method implements the like function for char (with no escape value).(package private) BooleanDataValue
like
(DataValueDescriptor pattern, DataValueDescriptor escape) This method implements the like function for char with an escape value.(package private) int
stringCompare
(SQLChar str1, SQLChar str2)
-
Field Details
-
collatorForCharacterDatatypes
Use this object for collation on character datatype. This collator object is passed as a parameter to the constructor. -
stringData
collatorForCharacterDatatypes will be used on this SQLChar to determine collationElementsForString. The collationElementsForString is used by the like method to do Collator specific comparison. This SQLChar object is passed as a parameter to the constructor.
-
-
Constructor Details
-
WorkHorseForCollatorDatatypes
WorkHorseForCollatorDatatypes(RuleBasedCollator collatorForCharacterDatatypes, SQLChar stringData)
-
-
Method Details
-
stringCompare
- Throws:
StandardException
- See Also:
-
like
This method implements the like function for char (with no escape value). The difference in this method and the same method in SQLChar is that here we use special Collator object to do the comparison rather than using the Collator object associated with the default jvm locale.- Parameters:
pattern
- The pattern to use- Returns:
- A SQL boolean value telling whether the first operand is like the second operand
- Throws:
StandardException
- Thrown on error
-
like
BooleanDataValue like(DataValueDescriptor pattern, DataValueDescriptor escape) throws StandardException This method implements the like function for char with an escape value.- Parameters:
pattern
- The pattern to use- Returns:
- A SQL boolean value telling whether the first operand is like the second operand
- Throws:
StandardException
- Thrown on error
-
getCollatorForCollation
RuleBasedCollator getCollatorForCollation()Get the RuleBasedCollator which is getting used for collation sensitive methods. -
hasSingleCollationElement
Check if the string consists of a single collation element.- Returns:
true
iff it's a single collation element- Throws:
StandardException
- See Also:
-