1    package geekblog;
2    
3    
4    import java.util.*;
5    
6    
7    /**
8     * Bean representing a single weblog entry.
9     */
10   public class BlogEntry
11     implements java.io.Serializable
12   {
13     private long ID;          // = Timestamp, in seconds
14     private Date Timestamp;
15     private String Text;
16     private String Title;
17   
18   
19     /**
20      *
21      */
22     public BlogEntry(String title, String text)
23     {
24       Timestamp = new Date();
25       Title = title;
26       Text = text;
27     }
28     /**
29      *
30      */
31     public BlogEntry(Date date, String title, String text)
32     {
33       Timestamp = date;
34       Title = title;
35       Text = text;
36     }
37   
38   
39     /**
40      * Return the Timestamp property, in seconds
41      */
42     public long getID()
43     { return Timestamp.getTime(); }
44     
45   
46     /**
47      * Return the Timestamp property
48      */
49     public Date getTimestamp()
50     { return Timestamp; }
51     /**
52      * Set the Timestamp property
53      */
54     public void setTimestamp(Date value)
55     { Timestamp = value; }
56     
57     
58     /**
59      * Return the Title property
60      */
61     public String getTitle()
62     { return Title; }
63     /**
64      * Set the Title property
65      */
66     public void setTitle(String value)
67     { Title = value; }
68   
69     
70     /**
71      * Return the Text property
72      */
73     public String getText()
74     { return Text; }
75     /**
76      * Set the Text property
77      */
78     public void setText(String value)
79     { Text = value; }
80   
81   
82     public String toString()
83     {
84       return "Entry " + getID() + ": " + getTimestamp() + "--" + getTitle() + " '" + getText() + "'";
85     }
86   }
87