Class PathSortByModificationTime

    • Constructor Summary

      Constructors 
      Constructor Description
      PathSortByModificationTime​(boolean recentFirst)
      Constructs a new SortByModificationTime sorter.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(PathWithAttributes path1, PathWithAttributes path2)  
      static PathSorter createSorter​(boolean recentFirst)
      Create a PathSorter that sorts by lastModified time.
      boolean isRecentFirst()
      Returns whether this sorter sorts recent files first.
      • Methods inherited from class java.lang.Object

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

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Field Detail

      • recentFirst

        private final boolean recentFirst
      • multiplier

        private final int multiplier
    • Constructor Detail

      • PathSortByModificationTime

        public PathSortByModificationTime​(boolean recentFirst)
        Constructs a new SortByModificationTime sorter.
        Parameters:
        recentFirst - if true, most recently modified paths should come first
    • Method Detail

      • createSorter

        @PluginFactory
        public static PathSorter createSorter​(@PluginAttribute(value="recentFirst",defaultBoolean=true)
                                              boolean recentFirst)
        Create a PathSorter that sorts by lastModified time.
        Parameters:
        recentFirst - if true, most recently modified paths should come first.
        Returns:
        A PathSorter.
      • isRecentFirst

        public boolean isRecentFirst()
        Returns whether this sorter sorts recent files first.
        Returns:
        whether this sorter sorts recent files first