Serializable
, Comparator<PathWithAttributes>
, PathSorter
@Plugin(name="SortByModificationTime", category="Core", printObject=true) public class PathSortByModificationTime extends Object implements PathSorter, Serializable
PathSorter
that sorts path by their LastModified attribute.Constructor | Description |
---|---|
PathSortByModificationTime(boolean recentFirst) |
Constructs a new SortByModificationTime sorter.
|
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.
|
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public PathSortByModificationTime(boolean recentFirst)
recentFirst
- if true, most recently modified paths should come first@PluginFactory public static PathSorter createSorter(@PluginAttribute(value="recentFirst",defaultBoolean=true) boolean recentFirst)
recentFirst
- if true, most recently modified paths should come first.public boolean isRecentFirst()
public int compare(PathWithAttributes path1, PathWithAttributes path2)
compare
in interface Comparator<PathWithAttributes>
Copyright © 1999-2018. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.