org.apache.commons.io.comparator
class ReverseComparator extends java.lang.Object implements java.util.Comparator, java.io.Serializable
Comparator
.Modifier and Type | Field and Description |
---|---|
private java.util.Comparator |
delegate |
Constructor and Description |
---|
ReverseComparator(java.util.Comparator delegate)
Construct an instance with the sepecified delegate
Comparator . |
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Object obj1,
java.lang.Object obj2)
Compare using the delegate Comparator, but reversing the result.
|
public ReverseComparator(java.util.Comparator delegate)
Comparator
.delegate
- The comparator to delegate topublic int compare(java.lang.Object obj1, java.lang.Object obj2)
compare
in interface java.util.Comparator
obj1
- The first object to compareobj2
- The second object to compareComparator.compare(Object, Object)
reversing the value (i.e. positive becomes negative and vice versa)Copyright (c) 2002-2015 Apache Software Foundation