1 package org.catacomb.interlish.report;
2
3 import java.text.SimpleDateFormat;
4 import java.util.Date;
5
6
7
8 public class Message {
9
10
11 String summary;
12 String[] body;
13 String timestamp;
14
15
16
17 public Message(String s) {
18 this(s, null);
19 }
20
21 public Message(String sum, String[] bdy) {
22 summary = sum;
23 body = bdy;
24 timestamp = makeTimestamp();
25 }
26
27
28 public String getText() {
29 return summary;
30 }
31
32
33 public String toString() {
34 return summary;
35 }
36
37
38 public boolean sameSubject(Message msg) {
39 return summary.equals(msg.getSummary());
40 }
41
42 public String getSummary() {
43 return summary;
44 }
45
46
47 public String[] getBody() {
48 return body;
49 }
50
51
52
53
54 public static String makeTimestamp() {
55 SimpleDateFormat f;
56 f = new SimpleDateFormat("HH:mm d MMM yyyy");
57 return f.format(new Date());
58 }
59
60
61
62 }