summaryrefslogtreecommitdiff
path: root/src/Chapter5/support/DateInfo.java
blob: 9a32d4c8a14fddd880924dd8bebea9a1ca3dbb7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* TweetTracker. Copyright (c) Arizona Board of Regents on behalf of Arizona State University
 * @author shamanth
 */
package Chapter5.support;

import java.util.Date;
import java.util.HashMap;

public class DateInfo implements Comparable
{
    public Date d;
    public HashMap<String,Integer> catcounts = new HashMap<String,Integer>();

    public int compareTo(Object o) {
        DateInfo temp = (DateInfo) o;
        if(temp.d.after(this.d))
        {
            return 1;
        }
        else
        if(temp.d.before(this.d))
        {
            return -1;
        }
        else
        {
            return 0;
        }
    }
}