|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.lucidviews.util.io.FileDateComparator
public class FileDateComparator
A FileComparator that compares files using their last-modified
timestamp.
By default this comparator places files in chronological order. I.e: more
recent files would be pushed to the end of a list and older files would
rise to the top.
This logic can be switched by constructing an instance with a
DateComparator that sorts dates in a reverse chronological
order.
Comparator,
FileComparator,
DateComparator| Field Summary | |
|---|---|
protected DateComparator |
_dateComparator
The comparator used to compare file timestamps. |
static FileDateComparator |
CHRONOLOGICAL
A FileDateComparator that puts files into chronological
order, based on their (last-modified) timestamp. |
static FileDateComparator |
REVERSE_CHRONOLOGICAL
A FileDateComparator that puts files into reverse
chronological order, based on their (last-modified) timestamp. |
| Constructor Summary | |
|---|---|
protected |
FileDateComparator()
The default constructor. |
protected |
FileDateComparator(DateComparator dateComparator)
Create a comparator that will order files according to their (last modified) timestamp. |
| Method Summary | |
|---|---|
int |
compare(File file1,
File file2)
|
boolean |
equals(Object obj)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final FileDateComparator CHRONOLOGICAL
FileDateComparator that puts files into chronological
order, based on their (last-modified) timestamp.
public static final FileDateComparator REVERSE_CHRONOLOGICAL
FileDateComparator that puts files into reverse
chronological order, based on their (last-modified) timestamp.
protected DateComparator _dateComparator
| Constructor Detail |
|---|
protected FileDateComparator()
protected FileDateComparator(DateComparator dateComparator)
dateComparator - the comparator to use to compare file timestamps| Method Detail |
|---|
public int compare(File file1,
File file2)
compare in interface Comparator<File>public boolean equals(Object obj)
equals in interface Comparator<File>equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||