KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > modules > admin > filemanager > TimeCopy


1 package com.openedit.modules.admin.filemanager;
2
3 import java.text.SimpleDateFormat JavaDoc;
4 import java.util.Date JavaDoc;
5
6 import com.openedit.page.Page;
7 import com.openedit.users.User;
8
9 public class TimeCopy implements Comparable JavaDoc
10 {
11     protected Date JavaDoc fieldDate;
12     protected Page fieldTo;
13     protected Page fieldFrom;
14     protected User fieldUser;
15     protected String JavaDoc fieldDescription;
16     protected SimpleDateFormat JavaDoc fieldFormat;
17     
18     public Date JavaDoc getDate()
19     {
20         return fieldDate;
21     }
22     public void setDate(Date JavaDoc inDate)
23     {
24         fieldDate = inDate;
25     }
26     public String JavaDoc getDescription()
27     {
28         return fieldDescription;
29     }
30     public void setDescription(String JavaDoc inDescription)
31     {
32         fieldDescription = inDescription;
33     }
34     public Page getFrom()
35     {
36         return fieldFrom;
37     }
38     public void setFrom(Page inFrom)
39     {
40         fieldFrom = inFrom;
41     }
42     public Page getTo()
43     {
44         return fieldTo;
45     }
46     public void setTo(Page inTo)
47     {
48         fieldTo = inTo;
49     }
50     public User getUser()
51     {
52         return fieldUser;
53     }
54     public void setUser(User inUser)
55     {
56         fieldUser = inUser;
57     }
58     public int compareTo(Object JavaDoc inObject)
59     {
60         TimeCopy copy = (TimeCopy) inObject;
61         return copy.getDate().compareTo(getDate());
62     }
63     public SimpleDateFormat JavaDoc getFormat()
64     {
65         return fieldFormat;
66     }
67     public void setFormat(SimpleDateFormat JavaDoc inFormat)
68     {
69         fieldFormat = inFormat;
70     }
71     
72     public String JavaDoc getFormattedDate()
73     {
74         return getFormat().format(getDate());
75     }
76 }
77
Popular Tags