KickJava   Java API By Example, From Geeks To Geeks.

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


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 LiteralChangeEvent implements TCChangeBufferEvent {
11   private final Object JavaDoc newValue;
12
13   public LiteralChangeEvent(Object JavaDoc newValue) {
14     this.newValue = newValue;
15   }
16
17   public Object JavaDoc getNewValue() {
18     return newValue;
19   }
20
21   public boolean isReference() {
22     return newValue instanceof ObjectID;
23   }
24
25   public void write(DNAWriter writer) {
26     writer.addLiteralValue(newValue);
27   }
28
29 }
Popular Tags