1 4 package com.tc.object.bytecode; 5 6 import com.tc.exception.ImplementMe; 7 import com.tc.object.ObjectID; 8 import com.tc.object.TCClass; 9 import com.tc.object.TCObject; 10 import com.tc.object.dna.api.DNA; 11 import com.tc.object.dna.api.DNAException; 12 import com.tc.object.dna.api.DNAWriter; 13 14 import gnu.trove.TLinkable; 15 16 19 public class NullTCObject implements TCObject { 20 21 public final static TCObject INSTANCE = new NullTCObject(); 22 23 private final static ObjectID NULL_ID = ObjectID.NULL_ID; 24 25 public static TCObject getNullTCObject() { 27 return INSTANCE; 28 } 29 30 public void setNext(TLinkable link) { 31 } 33 34 public void setPrevious(TLinkable link) { 35 37 } 38 39 public TLinkable getNext() { 40 return null; 42 } 43 44 public TLinkable getPrevious() { 45 return null; 47 } 48 49 public ObjectID getObjectID() { 50 return NULL_ID; 51 } 52 53 public Object getPeerObject() { 54 return null; 56 } 57 58 public TCClass getTCClass() { 59 return null; 61 } 62 63 public int clearReferences(int toClear) { 64 return 0; 65 } 66 67 public Object getResolveLock() { 68 return this; 69 } 70 71 public void objectFieldChanged(String classname, String fieldname, Object newValue, int index) { 72 } 74 75 public void booleanFieldChanged(String classname, String fieldname, boolean newValue, int index) { 76 } 78 79 public void byteFieldChanged(String classname, String fieldname, byte newValue, int index) { 80 82 } 83 84 public void charFieldChanged(String classname, String fieldname, char newValue, int index) { 85 } 87 88 public void doubleFieldChanged(String classname, String fieldname, double newValue, int index) { 89 } 91 92 public void floatFieldChanged(String classname, String fieldname, float newValue, int index) { 93 } 95 96 public void intFieldChanged(String classname, String fieldname, int newValue, int index) { 97 } 99 100 public void longFieldChanged(String classname, String fieldname, long newValue, int index) { 101 } 103 104 public void shortFieldChanged(String classname, String fieldname, short newValue, int index) { 105 } 107 108 public void logicalInvoke(int method, String methodName, Object [] parameters) { 109 } 111 112 public void hydrate(DNA from, boolean force) throws DNAException { 113 } 115 116 public void resolveReference(String fieldName) { 117 } 119 120 public void resolveArrayReference(int index) { 121 return; 123 } 124 125 public void setReference(String fieldName, ObjectID id) { 126 } 128 129 public void setValue(String fieldName, Object obj) { 130 } 132 133 public long getVersion() { 134 return 0; 136 } 137 138 public void setVersion(long version) { 139 } 141 142 public void dehydrate(DNAWriter to) throws DNAException { 143 } 145 146 public void markAccessed() { 147 } 149 150 public void clearAccessed() { 151 } 153 154 public boolean recentlyAccessed() { 155 return false; 156 } 157 158 public void clearReference(String fieldName) { 159 } 161 162 public void resolveAllReferences() { 163 } 166 167 public boolean getAndResetNew() { 168 throw new AssertionError (); 169 } 170 171 public void setIsNew() { 172 throw new AssertionError (); 173 } 174 175 public boolean isNew() { 176 throw new AssertionError (); 177 } 178 179 public boolean isShared() { 180 return true; 181 } 182 public void objectFieldChangedByOffset(String classname, long fieldOffset, Object newValue, int index) { 183 } 185 186 public void logicalInvoke(Object object, String methodSignature, Object [] params) { 187 throw new ImplementMe(); 188 } 189 190 public void disableAutoLocking() { 191 throw new ImplementMe(); 192 } 193 194 public boolean autoLockingDisabled() { 195 return false; 196 } 197 198 public String getFieldNameByOffset(long fieldOffset) { 199 throw new ImplementMe(); 200 } 201 202 public boolean canEvict() { 203 throw new ImplementMe(); 204 } 205 206 public void objectArrayChanged(int startPos, Object [] array, int length) { 207 } 209 210 public void primitiveArrayChanged(int startPos, Object array, int length) { 211 } 213 214 public int accessCount(int factor) { 215 throw new ImplementMe(); 216 } 217 218 public void literalValueChanged(Object newValue, Object oldValue) { 219 } 221 222 public void setLiteralValue(Object newValue) { 223 } 225 226 public ArrayIndexOutOfBoundsException checkArrayIndex(int index) { 227 return null; 228 } 229 230 } 231 | Popular Tags |