class ReverseComparator extends AbstractFileComparator implements java.io.Serializable
Comparator.| Modifier and Type | Field and Description |
|---|---|
private java.util.Comparator<java.io.File> |
delegate |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
ReverseComparator(java.util.Comparator<java.io.File> delegate)
Construct an instance with the sepecified delegate
Comparator. |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(java.io.File file1,
java.io.File file2)
Compare using the delegate Comparator, but reversing the result.
|
java.lang.String |
toString()
String representation of this file comparator.
|
sort, sortprivate static final long serialVersionUID
private final java.util.Comparator<java.io.File> delegate
public ReverseComparator(java.util.Comparator<java.io.File> delegate)
Comparator.delegate - The comparator to delegate topublic int compare(java.io.File file1,
java.io.File file2)
compare in interface java.util.Comparator<java.io.File>file1 - The first file to comparefile2 - The second file to compareComparator.compare(Object, Object)
reversing the value (i.e. positive becomes negative and vice versa)public java.lang.String toString()
toString in class AbstractFileComparatorCopyright (c) 2002-2016 Apache Software Foundation