KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > tests > jfun > parsec > rfc822 > DateTime


1 /*
2  * Created on Dec 10, 2004
3  *
4  * Author Ben Yu
5  */

6 package tests.jfun.parsec.rfc822;
7
8 /**
9  * @author Ben Yu
10  *
11  * Dec 10, 2004
12  */

13 public final class DateTime {
14   private final String JavaDoc weekday;
15   private final Date date;
16   private final Time time;
17   /**
18    * @param weekday
19    * @param date
20    * @param time
21    */

22   DateTime(final String JavaDoc weekday, final tests.jfun.parsec.rfc822.Date date,
23       final tests.jfun.parsec.rfc822.Time time) {
24     this.weekday = weekday;
25     this.date = date;
26     this.time = time;
27   }
28   /**
29    * @return Returns the date.
30    */

31   public Date getDate() {
32     return date;
33   }
34   /**
35    * @return Returns the time.
36    */

37   public Time getTime() {
38     return time;
39   }
40   /**
41    * @return Returns the weekday.
42    */

43   public String JavaDoc getWeekday() {
44     return weekday;
45   }
46   public String JavaDoc toString(){
47     if(weekday != null)
48       return weekday + ", " + date + " " + time;
49     else return date + " " + time;
50   }
51 }
52
Popular Tags