@Plugin(name="SortByModificationTime", category="Core", printObject=true) public class PathSortByModificationTime extends java.lang.Object implements PathSorter, java.io.Serializable
PathSorter
that sorts path by their LastModified attribute.Modifier and Type | Field and Description |
---|---|
private int |
multiplier |
private boolean |
recentFirst |
private static long |
serialVersionUID |
Constructor and Description |
---|
PathSortByModificationTime(boolean recentFirst)
Constructs a new SortByModificationTime sorter.
|
Modifier and Type | Method and 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.
|
private static final long serialVersionUID
private final boolean recentFirst
private final int multiplier
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 java.util.Comparator<PathWithAttributes>