java.io.Serializable, java.util.Comparator<java.io.File>class ReverseComparator extends AbstractFileComparator implements java.io.Serializable
Comparator.| Modifier and Type | Field | Description |
|---|---|---|
private java.util.Comparator<java.io.File> |
delegate |
| Constructor | Description |
|---|---|
ReverseComparator(java.util.Comparator<java.io.File> delegate) |
Construct an instance with the sepecified delegate
Comparator. |
| Modifier and Type | Method | 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, sortpublic 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-2017 Apache Software Foundation