Class ComparatorInverter

java.lang.Object
org.opencms.file.collectors.ComparatorInverter
All Implemented Interfaces:
Comparator<I_CmsResource>

public final class ComparatorInverter extends Object implements Comparator<I_CmsResource>
Wrapper around a comparator that inverts comparison results which may e.g. be used to invert sort orders.

This is used to create SortedSet instances that may sort in different order (ascending vs. descending).

Internal comparator result Transformed result
-1 +1
0 0
+1 -1

Since:
7.0.3