01: /*************************************************************************
02: * *
03: * 1) This source code file, in unmodified form, and compiled classes *
04: * derived from it can be used and distributed without restriction, *
05: * including for commercial use. (Attribution is not required *
06: * but is appreciated.) *
07: * *
08: * 2) Modified versions of this file can be made and distributed *
09: * provided: the modified versions are put into a Java package *
10: * different from the original package, edu.hws; modified *
11: * versions are distributed under the same terms as the original; *
12: * and the modifications are documented in comments. (Modification *
13: * here does not include simply making subclasses that belong to *
14: * a package other than edu.hws, which can be done without any *
15: * restriction.) *
16: * *
17: * David J. Eck *
18: * Department of Mathematics and Computer Science *
19: * Hobart and William Smith Colleges *
20: * Geneva, New York 14456, USA *
21: * Email: eck@hws.edu WWW: http://math.hws.edu/eck/ *
22: * *
23: *************************************************************************/package edu.hws.jcm.awt;
24:
25: /**
26: * A Tieable object has an associated serial number. The value of the serial
27: * should increase when the value of the object changes. A Tieable can "sync" with another
28: * Tieable, presumably by copying its serial number and other information.
29: * A given Tieable might only be able to synchronize with other Tiebles of
30: * certain types. If its sync() method is called with an object of the wrong
31: * type, it should probably thrown an IllegalArguemntException.
32: *
33: * See the "Tie" and "Controller" classes for information about how Tieable
34: * are used.
35: *
36: */
37: public interface Tieable extends java.io.Serializable {
38:
39: /**
40: * Get the serial number associated with this Tieable. If the
41: * value of this Tieable changes, then the serial number should
42: * increase.
43: */
44: public long getSerialNumber();
45:
46: /**
47: * This routine is called to tell this Tieable that the serial
48: * numbers of the Tieables that have been added to the Tie do not
49: * match. newest has a serial number that is at least as
50: * large as the serial number of any other Tieable in the Tie.
51: * This Tieable should synchronize its value and serial number
52: * with the "newest" Tieables.
53: * (Note: So far, I haven't found any reason to use
54: * the Tie parameter in this method! Maybe it should be removed.)
55: */
56: public void sync(Tie tie, Tieable newest);
57:
58: }
|