1
2 package hoplugins.teamAnalyzer.comparator;
3
4 import hoplugins.teamAnalyzer.vo.Match;
5
6 import java.util.Comparator;
7 import java.util.Date;
8
9
10 /***
11 * Comparator that orders based on match date
12 *
13 * @author <a href=mailto:draghetto@users.sourceforge.net>Massimiliano Amato</a>
14 */
15 public class MatchComparator implements Comparator {
16
17
18 /***
19 * Compare two objects
20 *
21 * @param o1
22 * @param o2
23 *
24 * @return
25 */
26 public int compare(Object o1, Object o2) {
27 Date s1 = ((Match) o1).getMatchDate();
28 Date s2 = ((Match) o2).getMatchDate();
29
30 return s2.compareTo(s1);
31 }
32 }