final class ReverseFileComparator extends AbstractFileComparator implements java.io.Serializable
File objects using the delegate Comparator.
Serialization is deprecated and will be removed in 3.0.
| Modifier and Type | Field and Description |
|---|---|
private java.util.Comparator<java.io.File> |
delegate |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
ReverseFileComparator(java.util.Comparator<java.io.File> delegate)
Constructs an instance with the specified delegate
Comparator. |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(java.io.File file1,
java.io.File file2)
Compares using the delegate Comparator, reversing the result.
|
java.lang.String |
toString()
Returns the String representation of this file comparator.
|
sort, sortprivate static final long serialVersionUID
private final java.util.Comparator<java.io.File> delegate
public ReverseFileComparator(java.util.Comparator<java.io.File> delegate)
Comparator.delegate - The comparator to delegate to.public int compare(java.io.File file1,
java.io.File file2)
compare in interface java.util.Comparator<java.io.File>file1 - The first file to compare.file2 - The second file to compare.Comparator.compare(Object, Object) reversing the value (i.e.
positive becomes negative and vice versa).public java.lang.String toString()
toString in class AbstractFileComparator