Comparator plug-ins implement the compare operations that determine the sort order of lists of values. Comparator plug-ins are provided for the following domains (all of the plug-ins are in the curam.util.client.domain.compare package):
Domain | Plug-in Class | Behavior |
---|---|---|
SVR_BLOB |
SvrBlobComparator |
Not sorted, as there is no useful sort order for these non-human-readable values. |
SVR_BOOLEAN |
SvrBooleanComparator |
Sorted with Boolean true values before false values. |
SVR_CHAR |
SvrCharComparator |
Sorted strictly numerically with no locale-aware processing. |
SVR_DATE |
SvrDateComparator |
Sorted chronologically with the earliest date first. |
SVR_DATETIME |
SvrDateTimeComparator |
Sorted chronologically with the earliest date-time first. |
CURAM_TIME |
CuramTimeComparator |
Sorted chronologically with the earliest time first. CURAM_TIME is based on the SVR_DATETIME domain, so values may included date information, but for comparisons, the date part is ignored and only the time part is used to determine the sort order. |
SVR_DOUBLE |
SvrDoubleComparator |
Sorted numerically; smallest value first. |
SVR_FLOAT |
SvrFloatComparator |
Sorted in the same manner as SVR_DOUBLE values. |
SVR_INT8 |
SvrInt8Comparator |
Sorted in the same manner as SVR_DOUBLE values. |
SVR_INT16 |
SvrInt16Comparator |
Sorted in the same manner as SVR_DOUBLE values. |
SVR_INT32 |
SvrInt32Comparator |
Sorted in the same manner as SVR_DOUBLE values. |
SVR_INT64 |
SvrInt64Comparator |
Sorted in the same manner as SVR_DOUBLE values. |
SVR_MONEY |
SvrMoneyComparator |
Sorted in the same manner as SVR_DOUBLE values. |
SVR_STRING |
SvrStringComparator |
Sorted lexicographically based on the numeric Unicode value of each character in the string. The comparison is not locale-aware. |
SVR_STRING |
SvrStringCaseInsensitiveComparator |
Sorted identically to SvrStringComparator except the case is ignored. |
SVR_STRING |
SvrStringLocaleAwareComparator |
Sorted according to the sorting rules defined by Unicode Collation Algorithm for the locale. See Localized (Cultural-aware) string sorting for details. |
SVR_UNBOUNDED_STRING |
SvrStringComparator |
Sorted in the same manner as SVR_STRING values. |
CODETABLE_CODE |
CodeTableCodeComparator |
Sorted according to the defined code-table sort order for the code values. If the defined sort orders are equal, the code descriptions are sorted lexicographically based on the numeric Unicode value of each character in the string. The comparison is not locale-aware. |
CODETABLE_CODE |
CodeTableCodeCaseInsensitiveComparator |
Sorted identically to CodeTableCodeComparator except case is ignored. |
CODETABLE_CODE |
CodeTableCodeLocaleAwareComparator |
Similar to the above, but the comparison of code descriptions uses the sorting rules defined by Unicode Collation Algorithm for the locale. See Localized (Cultural-aware) string sorting for details. |
The SvrStringComparator and CodeTableCodeComparator classes are configured by default to sort values in the SVR_STRING and CODETABLE_CODE domains respectively. If locale-aware sorting is required, the default plug-in configuration can be overridden to use the SvrStringLocaleAwareComparator and CodeTableCodeLocaleAwareComparator classes instead. If case-insensitive sorting is required, override using SvrStringCaseInsensitiveComparator and CodeTableCodeCaseInsensitiveComparator. See Domain Plug-in Configuration above for details on overriding the default plug-in configuration. Using these locale-aware comparators, lists will be sorted according to the expected sorting rules of the active locale. However, applying these sorting rules takes more time, so there will be some performance degradation. The implementation of locale-aware sorting uses Java's built-in sorting rules, so the availability of correct sorting rules for each locale depends on the Java JRE being used.