Class PreviewBrowserPanel.FileComparator

  • All Implemented Interfaces:
    Comparator<File>
    Enclosing class:
    PreviewBrowserPanel

    public static class PreviewBrowserPanel.FileComparator
    extends Object
    implements Comparator<File>
    Comparator for File objects. Only uses the file name, not the path, for comparison. Also, ignores the case.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • FileComparator

        public FileComparator()
    • Method Detail

      • compare

        public int compare​(File o1,
                           File o2)
        Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

        Uses only the file name, not the path for comparison (lower case).
        Specified by:
        compare in interface Comparator<File>
        Parameters:
        o1 - the first object to be compared.
        o2 - the second object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.