KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > laures > cewolf > storage > SessionStorageItem


1 /*
2  * Created on Aug 2, 2004
3  *
4  * To change the template for this generated file go to
5  * Window - Preferences - Java - Code Generation - Code and Comments
6  */

7 package de.laures.cewolf.storage;
8
9 import java.util.Date JavaDoc;
10
11 import de.laures.cewolf.ChartImage;
12
13 /**
14  * @author brianf
15  *
16  * To change the template for this generated type comment go to Window -
17  * Preferences - Java - Code Generation - Code and Comments
18  */

19 public class SessionStorageItem
20 {
21   String JavaDoc cid = null;
22   ChartImage chart = null;
23   Date JavaDoc timeout = null;
24
25   public SessionStorageItem( ChartImage theChart, String JavaDoc theCid, Date JavaDoc theTimeout )
26   {
27     chart = theChart;
28     cid = theCid;
29     timeout = theTimeout;
30   }
31   
32   public String JavaDoc toString()
33   {
34     return ("SSI: id:"+cid+" expires:"+timeout);
35   }
36   public final boolean isExpired(Date JavaDoc currentTime)
37   {
38     return currentTime.after(timeout);
39   }
40   /**
41    * @return Returns the chart.
42    */

43   public ChartImage getChart()
44   {
45     return chart;
46   }
47   /**
48    * @param chart
49    * The chart to set.
50    */

51   public void setChart( ChartImage chart )
52   {
53     this.chart = chart;
54   }
55   /**
56    * @return Returns the cid.
57    */

58   public String JavaDoc getCid()
59   {
60     return cid;
61   }
62   /**
63    * @param cid
64    * The cid to set.
65    */

66   public void setCid( String JavaDoc cid )
67   {
68     this.cid = cid;
69   }
70   /**
71    *
72    */

73   public SessionStorageItem()
74   {
75     super();
76     // TODO Auto-generated constructor stub
77
}
78
79   /**
80    * @return Returns the timeout.
81    */

82   public Date JavaDoc getTimeout()
83   {
84     return timeout;
85   }
86   /**
87    * @param timeout
88    * The timeout to set.
89    */

90   public void setTimeout( Date JavaDoc timeout )
91   {
92     this.timeout = timeout;
93   }
94 }
Popular Tags