类 InvertibleComparator<T>

    • 构造器详细资料

      • InvertibleComparator

        public InvertibleComparator​(Comparator<T> comparator)
        Create an InvertibleComparator that sorts ascending by default. For the actual comparison, the specified Comparator will be used.
        参数:
        comparator - the comparator to decorate
      • InvertibleComparator

        public InvertibleComparator​(Comparator<T> comparator,
                                    boolean ascending)
        Create an InvertibleComparator that sorts based on the provided order. For the actual comparison, the specified Comparator will be used.
        参数:
        comparator - the comparator to decorate
        ascending - the sort order: ascending (true) or descending (false)