View Javadoc

1   package org.catacomb.be;
2   
3   
4   public class ChangeEvent {
5   
6       String type;
7       Object src;
8   
9       int count;
10  
11      private static int counter = 0;
12  
13  
14      // REFAC - clearer
15  
16      private ChangeEvent() {
17          count = counter;
18      }
19  
20      public ChangeEvent(String s, Object obj) {
21          type = s;
22          src = obj;
23          count = counter;
24          counter += 1;
25      }
26  
27  
28      public Object getSource() {
29          return src;
30      }
31  
32      private ChangeEvent(ChangeEvent ce) {
33          count = ce.count;
34          src = ce.src;
35          type = ce.type;
36      }
37  
38      public ChangeEvent makeCopy() {
39          return new ChangeEvent(this);
40      }
41  
42  
43      public boolean laterThan(ChangeEvent ce) {
44          return (ce == null || count > ce.count);
45      }
46  
47  
48  }