Class AbstractFileComparator

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.File[] sort​(java.io.File... files)
      Sorts an array of files.
      java.util.List<java.io.File> sort​(java.util.List<java.io.File> files)
      Sorts a List of files.
      java.lang.String toString()
      String representation of this file comparator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • AbstractFileComparator

        AbstractFileComparator()
    • Method Detail

      • sort

        public java.io.File[] sort​(java.io.File... files)
        Sorts an array of files.

        This method uses Arrays.sort(Object[], Comparator) and returns the original array.

        Parameters:
        files - The files to sort, may be null.
        Returns:
        The sorted array.
        Since:
        2.0
      • sort

        public java.util.List<java.io.File> sort​(java.util.List<java.io.File> files)
        Sorts a List of files.

        This method uses List.sort(Comparator) and returns the original list.

        Parameters:
        files - The files to sort, may be null.
        Returns:
        The sorted list.
        Since:
        2.0
      • toString

        public java.lang.String toString()
        String representation of this file comparator.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of this file comparator.