Class StringSortFn

java.lang.Object
fluent.functions.icu.list.StringSortFn
All Implemented Interfaces:
fluent.functions.FluentFunction

public class StringSortFn extends Object implements fluent.functions.FluentFunction
SORT() items

SORT is a non-reducing string formatting and string sorting function. SORT works in the following manner:

  1. 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)).
  2. 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 different
    • tertiary: 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 decomposed
    • canonical: decompose characters with canonical variants (form D)
    • full: decompose canonical variants and Unicode compatibility variants (form KD)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<fluent.types.FluentValue<?>>
    apply​(fluent.functions.ResolvedParameters params, fluent.bundle.resolver.Scope scope)
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface fluent.functions.FluentFunction

    select
  • Field Details

  • Constructor Details

    • StringSortFn

      public StringSortFn()
  • Method Details

    • name

      public String name()
      Specified by:
      name in interface fluent.functions.FluentFunction
    • apply

      public List<fluent.types.FluentValue<?>> apply(fluent.functions.ResolvedParameters params, fluent.bundle.resolver.Scope scope)
      Specified by:
      apply in interface fluent.functions.FluentFunction