java.lang.Object | |
↳ | org.springframework.util.comparator.InvertibleComparator<T> |
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create an InvertibleComparator that sorts ascending by default.
| |||||||||||
Create an InvertibleComparator that sorts based on the provided order.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invert the sort order: ascending -> descending or
descending -> ascending.
| |||||||||||
Return the sort order: ascending (true) or descending (false).
| |||||||||||
Specify the sort order: ascending (true) or descending (false).
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.util.Comparator
|
Create an InvertibleComparator that sorts ascending by default. For the actual comparison, the specified Comparator will be used.
comparator | the comparator to decorate |
---|
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) |
Invert the sort order: ascending -> descending or descending -> ascending.
Return the sort order: ascending (true) or descending (false).
Specify the sort order: ascending (true) or descending (false).