Package fluent.functions.icu.list
Class StringSortFn
java.lang.Object
fluent.functions.icu.list.StringSortFn
- All Implemented Interfaces:
fluent.functions.FluentFunction
SORT() items
SORT is a non-reducing string formatting and string sorting function. SORT works in the following manner:
-
For each non-String item, convert to a String using the implicit formatter for the type.
NOTE: if specific formatting is preferred, it should be performed prior to sorting. For example,
SORT(NUMBER($value, $anotherValue)). - Sort the String values and return the list of values.
To reiterate, all values emitted from a Sort will be String values. Therefore, if (e.g., numeric) type manipulation is needed, it must be performed prior to sorting.
Note: SORT() is a String-based sort. Therefore, it is not generally appropriate to sort numbers, since it will do so following number formatting.
SORT() options:
-
order:"natural" or "reversed". Default is natural. Reverses sort order if "reversed". -
strength:sorting strength: "primary","secondary","tertiary","identical". The meanings of these are Locale-dependent.primary:different base letters considered different (e.g., "a" vs. "b")secondary:different accented forms considered differenttertiary:e.g.: case differences "a" vs "A"identical:all character differences are considered unique
-
decomposition:sorting decomposition: "none","full","canonical". For languages with accented characters, canonical or full decomposition should be used.none:accented characters are not decomposedcanonical:decompose characters with canonical variants (form D)full:decompose canonical variants and Unicode compatibility variants (form KD)
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
StringSortFn
public StringSortFn()
-
-
Method Details
-
name
- Specified by:
namein interfacefluent.functions.FluentFunction
-
apply
public List<fluent.types.FluentValue<?>> apply(fluent.functions.ResolvedParameters params, fluent.bundle.resolver.Scope scope)- Specified by:
applyin interfacefluent.functions.FluentFunction
-