KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > chat > business > SnapshotImpl


1 package chat.business;
2
3 import java.util.Vector JavaDoc;
4 import chat.spec.*;
5
6 /**
7  * This class is used as a way to return both a vector and a long from
8  * a method in the Discussion class. It holds a "snapshot in time" of the
9  * state of the discussion. The state field holds the timestamp of that
10  * state.
11  */

12 public class SnapshotImpl implements Snapshot{
13
14   /**
15    * A list of all the messages (Message objects).
16    */

17   public Vector JavaDoc contents;
18
19   /**
20    * The timestamp in place when this snapshot was taken.
21    */

22   public long state;
23
24   /**
25    * Create a new snapshot. Be sure that the contents of the vector
26    * are in sync with the state value.
27    */

28   public SnapshotImpl(Vector JavaDoc contents, long state) {
29     this.contents = contents;
30     this.state = state;
31   }
32   public Vector JavaDoc getContents(){
33      return contents;
34   }
35   public long getState(){
36       return state;
37   }
38 }
39
40
Popular Tags