|
|||||||||||||||||||
| This license of Clover is provided to support the development of Flock only. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover. | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| ItemDateComparator.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
package net.sf.flock.filter; |
|
| 2 |
|
|
| 3 |
import java.util.Comparator; |
|
| 4 |
|
|
| 5 |
import net.sf.flock.ItemI; |
|
| 6 |
|
|
| 7 |
/** |
|
| 8 |
* @version $Revision$ |
|
| 9 |
* @author $Author$ |
|
| 10 |
*/ |
|
| 11 |
class ItemDateComparator implements Comparator {
|
|
| 12 |
|
|
| 13 |
private boolean reverse = true; |
|
| 14 |
|
|
| 15 |
/** |
|
| 16 |
* @see java.util.Comparator#compare(Object, Object) |
|
| 17 |
*/ |
|
| 18 | 0 |
public int compare(Object arg0, Object arg1) {
|
| 19 | 0 |
ItemI article0 = (ItemI) arg0; |
| 20 | 0 |
ItemI article1 = (ItemI) arg1; |
| 21 |
|
|
| 22 | 0 |
int d = article0.getCreationTime().compareTo(article1.getCreationTime()); |
| 23 | 0 |
return d!=0 ? (this.reverse ? -d : d) : article0.getTitle().compareTo(article1.getTitle()); |
| 24 |
} |
|
| 25 |
|
|
| 26 |
} |
|
| 27 |
|
|
||||||||||