KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > core > api > TestDNA


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

5 package com.tc.objectserver.core.api;
6
7 import com.tc.object.ObjectID;
8 // import com.tc.object.TCObject;
9
import com.tc.object.dna.api.DNA;
10 import com.tc.object.dna.api.DNACursor;
11 import com.tc.object.dna.api.DNAException;
12
13 /**
14  * @author steve
15  */

16 public class TestDNA implements DNA {
17   public DNACursor cursor;
18   public ObjectID objectID;
19   public long version;
20   public String JavaDoc typeName = "SomeClassName";
21   public ObjectID parentObjectID = ObjectID.NULL_ID;
22   private boolean isDelta;
23   public String JavaDoc loaderDesc = "system.loader";
24
25   public TestDNA(DNACursor cursor) {
26     this.cursor = cursor;
27   }
28
29   public TestDNA(DNACursor cursor, String JavaDoc className) {
30     this.cursor = cursor;
31     this.typeName = className;
32   }
33
34   public TestDNA(ObjectID oid) {
35     this.objectID = oid;
36
37   }
38
39   public TestDNA(ObjectID id, boolean isDelta) {
40     this.objectID = id;
41     this.isDelta = isDelta;
42   }
43
44   /*
45    * public void setObject(TCObject object) throws DNAException { return; }
46    */

47
48   public String JavaDoc getTypeName() {
49     return typeName;
50   }
51
52   public ObjectID getObjectID() throws DNAException {
53     return objectID;
54   }
55
56   public DNACursor getCursor() {
57     return cursor;
58   }
59
60   public boolean hasLength() {
61     return false;
62   }
63
64   public int getArraySize() {
65     return 0;
66   }
67
68   public String JavaDoc getDefiningLoaderDescription() {
69     return loaderDesc;
70   }
71
72   public ObjectID getParentObjectID() throws DNAException {
73     return parentObjectID;
74   }
75
76   public void setHeaderInformation(ObjectID id, ObjectID parentID, String JavaDoc type, int length, long version)
77       throws DNAException {
78     return;
79   }
80
81   public void addPhysicalAction(String JavaDoc field, Object JavaDoc value) throws DNAException {
82     return;
83   }
84
85   public void addLogicalAction(int method, Object JavaDoc[] parameters) {
86     return;
87   }
88
89   public long getVersion() {
90     return this.version;
91   }
92
93   public boolean isDelta() {
94     return isDelta;
95   }
96
97   public String JavaDoc toString() {
98     return "TestDNA(" + objectID + ", version = " + version + ")";
99   }
100 }
101
Popular Tags