| java.lang.Object org.springframework.util.comparator.InvertibleComparator
InvertibleComparator | public class InvertibleComparator implements Comparator,Serializable(Code) | | 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.
author: Keith Donald author: Juergen Hoeller since: 1.2.2 |
InvertibleComparator | public InvertibleComparator(Comparator comparator)(Code) | | Create an InvertibleComparator that sorts ascending by default.
For the actual comparison, the specified Comparator will be used.
Parameters: comparator - the comparator to decorate |
InvertibleComparator | public InvertibleComparator(Comparator comparator, boolean ascending)(Code) | | Create an InvertibleComparator that sorts based on the provided order.
For the actual comparison, the specified Comparator will be used.
Parameters: comparator - the comparator to decorate Parameters: ascending - the sort order: ascending (true) or descending (false) |
hashCode | public int hashCode()(Code) | | |
invertOrder | public void invertOrder()(Code) | | Invert the sort order: ascending -> descending or
descending -> ascending.
|
isAscending | public boolean isAscending()(Code) | | Return the sort order: ascending (true) or descending (false).
|
setAscending | public void setAscending(boolean ascending)(Code) | | Specify the sort order: ascending (true) or descending (false).
|
|
|