|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.file.collectors.ComparatorInverter
public final class ComparatorInverter
Wrapper around a comparator that inverts comparison results which may e.g. be used to invert sort orders.
This is used to create instances that may
sort in different order (ascending vs. descending).SortedSet
| Internal comparator result | Transformed result |
|---|---|
| -1 | +1 |
| 0 | 0 |
| +1 | -1 |
| Constructor Summary | |
|---|---|
ComparatorInverter(java.util.Comparator<I_CmsResource> toInvert)
Creates a comparator that will invert the result of the given comparator. |
|
| Method Summary | |
|---|---|
int |
compare(I_CmsResource o1,
I_CmsResource o2)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Constructor Detail |
|---|
public ComparatorInverter(java.util.Comparator<I_CmsResource> toInvert)
toInvert - the comparator to invert results of| Method Detail |
|---|
public int compare(I_CmsResource o1,
I_CmsResource o2)
compare in interface java.util.Comparator<I_CmsResource>Comparator.compare(java.lang.Object, java.lang.Object)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||