1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package de.bea.domingo.groupware;
24
25 import java.text.SimpleDateFormat;
26 import java.util.Calendar;
27
28 import de.bea.domingo.map.BaseDigest;
29 import de.bea.domingo.util.GregorianDate;
30 import de.bea.domingo.util.GregorianTime;
31
32 /***
33 * Represents a digest of a Notes mail document.
34 *
35 * @author <a href=mailto:kriede@users.sourceforge.net>Kurt Riede</a>
36 */
37 public final class EmailDigest extends BaseDigest {
38
39 private String who;
40
41 private Calendar date;
42
43 private Calendar time;
44
45 private String subject;
46
47 /***
48 * @return Returns the date.
49 */
50 public Calendar getDate() {
51 return date;
52 }
53
54 /***
55 * @param calendar The date to set.
56 */
57 public void setDate(final Calendar calendar) {
58 this.date = calendar instanceof GregorianDate ? calendar : new GregorianDate(calendar);
59 }
60
61 /***
62 * @return Returns the subject.
63 */
64 public String getSubject() {
65 return subject;
66 }
67
68 /***
69 * @param text The subject to set.
70 */
71 public void setSubject(final String text) {
72 this.subject = text;
73 }
74
75 /***
76 * @return Returns the time.
77 */
78 public Calendar getTime() {
79 return time;
80 }
81
82 /***
83 * @param calendar The time to set.
84 */
85 public void setTime(final Calendar calendar) {
86 this.time = calendar instanceof GregorianTime ? calendar : new GregorianTime(calendar);
87 }
88
89 /***
90 * @return Returns the who.
91 */
92 public String getWho() {
93 return who;
94 }
95
96 /***
97 * @param person The who to set.
98 */
99 public void setWho(final String person) {
100 this.who = person;
101 }
102
103 /***
104 * @return a string representation of the object.
105 * @see java.lang.Object#toString()
106 */
107 public String toString() {
108 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss Z");
109 return "" + sdf.format(this.getDate().getTime()) + " " + getWho() + " " + getSubject();
110 }
111 }