Class BrowseTermComparator

java.lang.Object
io.goobi.viewer.model.termbrowsing.BrowseTermComparator
All Implemented Interfaces:
Serializable, Comparator<BrowseTerm>

public class BrowseTermComparator extends Object implements Comparator<BrowseTerm>, Serializable
Custom string comparator for browsing terms (case-insensitive, ignores brackets, natural sorting).
See Also:
  • Constructor Details

    • BrowseTermComparator

      public BrowseTermComparator(Locale locale)
  • Method Details

    • compare

      public int compare(BrowseTerm o1, BrowseTerm o2)
      Specified by:
      compare in interface Comparator<BrowseTerm>
      Parameters:
      o1 -
      o2 -
    • normalizeString

      public static String normalizeString(String str, String ignoreChars)
      Parameters:
      str - String to normalize
      ignoreChars - Optional string containing leading characters to remove from the string
      Returns:
      Cleaned-up string for comparison