类 InvertibleComparator<T>
- java.lang.Object
- org.springframework.util.comparator.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 8Comparator.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(Comparator<T> comparator)已过时。Create an InvertibleComparator that sorts ascending by default.InvertibleComparator(Comparator<T> comparator, boolean ascending)已过时。Create an InvertibleComparator that sorts based on the provided order.
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 intcompare(T o1, T o2)已过时。booleanequals(Object other)已过时。inthashCode()已过时。voidinvertOrder()已过时。Invert the sort order: ascending -> descending or descending -> ascending.booleanisAscending()已过时。Return the sort order: ascending (true) or descending (false).voidsetAscending(boolean ascending)已过时。Specify the sort order: ascending (true) or descending (false).StringtoString()已过时。从接口继承的方法 java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
构造器详细资料
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 decorateascending- the sort order: ascending (true) or descending (false)
方法详细资料
setAscending
public void setAscending(boolean ascending)
已过时。Specify the sort order: ascending (true) or descending (false).
isAscending
public boolean isAscending()
已过时。Return the sort order: ascending (true) or descending (false).
invertOrder
public void invertOrder()
已过时。Invert the sort order: ascending -> descending or descending -> ascending.
equals
public boolean equals(@Nullable Object other)
已过时。- 指定者:
equals在接口中Comparator<T>- 覆盖:
equals在类中Object