类 InvertibleComparator<T>

  • 类型参数:
    T - the type of objects that may be compared by this comparator
    所有已实现的接口:
    Serializable, Comparator<T>

    @Deprecated
    public class InvertibleComparator<T>
    extends Object
    implements Comparator<T>, Serializable
    已过时。
    as of Spring Framework 5.0, in favor of the standard JDK 8 Comparator.reversed()
    A decorator for a comparator, with an "ascending" flag denoting whether comparison results should be treated in forward (standard ascending) order or flipped for reverse (descending) order.
    从以下版本开始:
    1.2.2
    作者:
    Keith Donald, Juergen Hoeller
    另请参阅:
    序列化表格
    • 构造器详细资料

      • 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)