Package org.omegat.util
Class StreamUtil
java.lang.Object
org.omegat.util.StreamUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic Comparator<String>comparatorByList(List<String> order) Get a comparator that sorts according to the provided list.static <T> Comparator<T>localeComparator(Function<? super T, ? extends String> keyExtractor) Get a comparator that compares based on PRIMARY differences with the current default locale.static <T> Predicate<T>patternFilter(String regex, Function<T, String> stringExtractor)
-
Method Details
-
localeComparator
Get a comparator that compares based on PRIMARY differences with the current default locale.- Parameters:
keyExtractor- Function for obtaining strings that theCollatorcan compare- Returns:
- A comparator useful for e.g. sorting lists of files in a stable fashion
-
comparatorByList
Get a comparator that sorts according to the provided list. Items not appearing in the list are sorted alphabetically. -
patternFilter
-