Package com.helger.commons.compare
Class CollatorHelper
java.lang.Object
com.helger.commons.compare.CollatorHelper
Helper class to easily create commonly used
Collator objects.- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionstatic EChangeClear all cached collators.static CollatorgetCollatorSpaceBeforeDot(Locale aLocale) Create a collator that is based on the standard collator but sorts spaces before dots, because spaces are more important word separators than dots.
-
Method Details
-
getCollatorSpaceBeforeDot
@Nonnull @ReturnsMutableCopy public static Collator getCollatorSpaceBeforeDot(@Nullable Locale aLocale) Create a collator that is based on the standard collator but sorts spaces before dots, because spaces are more important word separators than dots. Another example is the correct sorting of things like "1.1 a" vs. "1.1.1 b" . This is the default collator used for sorting by default!- Parameters:
aLocale- The locale for which the collator is to be retrieved. May benullto indicate the usage of the default locale.- Returns:
- The created
RuleBasedCollatorand nevernull.
-
clearCache
Clear all cached collators.- Returns:
EChange
-