Class LastModifiedTimeFileComparator

  • All Implemented Interfaces:
    Comparator<File>

    public class LastModifiedTimeFileComparator
    extends Object
    implements Comparator<File>
    Compare two files based on file modification time.
    • Constructor Detail

      • LastModifiedTimeFileComparator

        public LastModifiedTimeFileComparator()
    • Method Detail

      • compare

        public int compare​(File o1,
                           File o2)
        Compare two files based on file modification time.
        Specified by:
        compare in interface Comparator<File>
        Parameters:
        o1 - The first file to be compared.
        o2 - The second file to be compared.
        Returns:
        A negative value if the first file was the most recently modified, a positive value if the second was the most recently modified, or zero if there is no discernible difference between the last modify times.