Class BrowseTermComparator
java.lang.Object
io.goobi.viewer.model.termbrowsing.BrowseTermComparator
- All Implemented Interfaces:
Serializable,Comparator<BrowseTerm>
Custom string comparator for browsing terms (case-insensitive, ignores brackets, natural sorting).
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(BrowseTerm o1, BrowseTerm o2) static StringnormalizeString(String str, String ignoreChars) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
BrowseTermComparator
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<BrowseTerm>- Parameters:
o1- first browse term to compareo2- second browse term to compare- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second
-
normalizeString
- Parameters:
str- String to normalizeignoreChars- Optional string containing leading characters to remove from the string- Returns:
- Cleaned-up string for comparison
-