01: package chat.business;
02:
03: import java.util.Vector;
04: import chat.spec.*;
05:
06: /**
07: * This class is used as a way to return both a vector and a long from
08: * a method in the Discussion class. It holds a "snapshot in time" of the
09: * 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 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 contents, long state) {
29: this .contents = contents;
30: this .state = state;
31: }
32:
33: public Vector getContents() {
34: return contents;
35: }
36:
37: public long getState() {
38: return state;
39: }
40: }
|