Class NumericComparator<T>

java.lang.Object
io.goobi.viewer.controller.sorting.NumericComparator<T>
Type Parameters:
T - the type of elements to be compared
All Implemented Interfaces:
Comparator<T>

public class NumericComparator<T> extends Object implements Comparator<T>
Comparator that orders elements by the integer value of their string representation, falling back to lexicographic comparison when parsing fails, with support for ascending or descending order.
  • Constructor Details

    • NumericComparator

      public NumericComparator(Function<T,String> stringifier)
    • NumericComparator

      public NumericComparator(boolean asc, Function<T,String> stringifier)
  • Method Details