KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > change > event > PhysicalChangeEvent


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object.change.event;
5
6 import com.tc.object.ObjectID;
7 import com.tc.object.change.TCChangeBufferEvent;
8 import com.tc.object.dna.api.DNAWriter;
9
10 public class PhysicalChangeEvent implements TCChangeBufferEvent {
11   private final Object JavaDoc newValue;
12   private final String JavaDoc fieldname;
13
14   public PhysicalChangeEvent(String JavaDoc fieldname, Object JavaDoc newValue) {
15     this.newValue = newValue;
16     this.fieldname = fieldname;
17   }
18
19   public String JavaDoc getFieldName() {
20     return fieldname;
21   }
22
23   public Object JavaDoc getNewValue() {
24     return newValue;
25   }
26
27   public boolean isReference() {
28     return newValue instanceof ObjectID;
29   }
30
31   public void write(DNAWriter writer) {
32     writer.addPhysicalAction(fieldname, newValue);
33   }
34
35 }
Popular Tags