KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > common > NULLState


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.common;
13
14 import com.versant.core.metadata.ClassMetaData;
15 import com.versant.core.metadata.FetchGroup;
16 import com.versant.core.metadata.ModelMetaData;
17 import com.versant.core.jdo.*;
18 import com.versant.core.server.OIDGraph;
19 import com.versant.core.util.IntArray;
20 import com.versant.core.util.OIDObjectOutput;
21 import com.versant.core.util.OIDObjectInput;
22
23 import javax.jdo.spi.PersistenceCapable;
24 import java.io.ObjectInput JavaDoc;
25 import java.io.ObjectOutput JavaDoc;
26 import java.io.IOException JavaDoc;
27 import java.util.Date JavaDoc;
28
29 /**
30  * This state is represents an oid that does not exist in the datastore but is referenced from
31  * some other instance. It will only be used if refs to this class must be
32  * treated as null when broken.
33  * <p/>
34  * This class is used as a singleton as it acts as a placeholder. It remains stateless.
35  */

36 public final class NULLState extends State {
37
38     public final static NULLState NULL_STATE = new NULLState();
39
40     public NULLState() {
41     }
42
43     private void throwExc() {
44         throw BindingSupportImpl.getInstance().internal(
45                 "method should not be invoked");
46     }
47
48     public boolean isCacheble() {
49         return false;
50     }
51
52     public boolean isFieldNullorZero(int stateFieldNo) {
53         return false; //To change body of implemented methods use File | Settings | File Templates.
54
}
55
56     public void addRefs(VersantPersistenceManagerImp sm, PCStateMan pcStateMan) {
57         throwExc();
58     }
59
60     public boolean checkKeyFields(OID oid) {
61         throwExc();
62         return false;
63     }
64
65     public void clear() {
66         throwExc();
67     }
68
69     public void clearApplicationIdentityFields() {
70         throwExc();
71     }
72
73     public void clearCollectionFields() {
74         throwExc();
75     }
76
77     public void clearDirtyFields() {
78         throwExc();
79     }
80
81     public void clearNonAutoSetFields() {
82         throwExc();
83     }
84
85     public void clearNonFilled(State state) {
86         throwExc();
87     }
88
89     public void clearSCOFields() {
90         throwExc();
91     }
92
93     public void clearTransactionNonPersistentFields() {
94         throwExc();
95     }
96
97     public int compareToPass1(State state) {
98         throwExc();
99         return 0;
100     }
101
102     public boolean containFields(int[] stateFieldNos) {
103         throwExc();
104         return false;
105     }
106
107     public boolean containFieldsAbs(int[] absFieldNos) {
108         throwExc();
109         return false;
110     }
111
112     public boolean containsApplicationIdentityFields() {
113         throwExc();
114         return false;
115     }
116
117     public boolean containsFetchGroup(FetchGroup fetchGroup) {
118         throwExc();
119         return false;
120     }
121
122     public boolean containsField(int stateFieldNo) {
123         throwExc();
124         return false;
125     }
126
127     public boolean containsFieldAbs(int absFieldNo) {
128         throwExc();
129         return false;
130     }
131
132     public boolean containsPass1Fields() {
133         throwExc();
134         return false;
135     }
136
137     public boolean containsPass2Fields() {
138         throwExc();
139         return false;
140     }
141
142     public boolean containsValidAppIdFields() {
143         throwExc();
144         return false;
145     }
146
147     public void copyOptimisticLockingField(State state) {
148         throwExc();
149     }
150
151     public void copyFields(OID oid) {
152         throwExc();
153     }
154
155     public void copyFieldsForOptimisticLocking(State state,
156             VersantPersistenceManagerImp sm) {
157         throwExc();
158     }
159
160     public void copyKeyFields(OID oid) {
161         throwExc();
162     }
163
164     public void copyKeyFieldsUpdate(OID oid) {
165         throwExc();
166     }
167
168     public void findDirectEdges(OIDGraph graph,
169             IntArray edges) {
170         throwExc();
171     }
172
173     public boolean getBooleanField(int stateFieldNo) {
174         throwExc();
175         return false;
176     }
177
178     public boolean getBooleanFieldAbs(int absFieldNo) {
179         throwExc();
180         return false;
181     }
182
183     public byte getByteField(int stateFieldNo) {
184         throwExc();
185         return 0;
186     }
187
188     public byte getByteFieldAbs(int absFieldNo) {
189         throwExc();
190         return 0;
191     }
192
193     public char getCharField(int stateFieldNo) {
194         throwExc();
195         return 0;
196     }
197
198     public char getCharFieldAbs(int absFieldNo) {
199         throwExc();
200         return 0;
201     }
202
203     public int getClassIndex() {
204         throwExc();
205         return 0;
206     }
207
208     public ClassMetaData getClassMetaData() {
209         throwExc();
210         return null;
211     }
212
213     public ClassMetaData getClassMetaData(ModelMetaData jmd) {
214         throwExc();
215         return null;
216     }
217
218     public State getCopy() {
219         throwExc();
220         return null;
221     }
222
223     public boolean fillToStoreState(State stateToStore, PersistenceContext sm,
224             VersantStateManager pcStateMan) {
225         throwExc();
226         return false;
227     }
228
229     public double getDoubleField(int stateFieldNo) {
230         throwExc();
231         return 0;
232     }
233
234     public double getDoubleFieldAbs(int absFieldNo) {
235         throwExc();
236         return 0;
237     }
238
239     public int getFieldNos(int[] buf) {
240         throwExc();
241         return 0;
242     }
243
244     public float getFloatField(int stateFieldNo) {
245         throwExc();
246         return 0;
247     }
248
249     public float getFloatFieldAbs(int absFieldNo) {
250         throwExc();
251         return 0;
252     }
253
254     public Object JavaDoc getInternalObjectField(int field) {
255         throwExc();
256         return null;
257     }
258
259     public Object JavaDoc getInternalObjectFieldAbs(int field) {
260         throwExc();
261         return null;
262     }
263
264     public int getIntField(int stateFieldNo) {
265         throwExc();
266         return 0;
267     }
268
269     public int getIntFieldAbs(int absFieldNo) {
270         throwExc();
271         return 0;
272     }
273
274     public long getLongField(int stateFieldNo) {
275         throwExc();
276         return 0;
277     }
278
279     public long getLongFieldInternal(int stateFieldNo) {
280         throwExc();
281         return 0;
282     }
283
284     public long getLongFieldAbs(int absFieldNo) {
285         throwExc();
286         return 0;
287     }
288
289     public Object JavaDoc getObjectField(int stateFieldNo, PersistenceCapable owningPC,
290             PersistenceContext sm, OID oid) {
291         throwExc();
292         return null;
293     }
294
295     public Object JavaDoc getObjectFieldAbs(int absFieldNo,
296             PersistenceCapable owningPC, PersistenceContext sm,
297             OID oid) {
298         throwExc();
299         return null;
300     }
301
302     public int getPass1FieldNos(int[] buf) {
303         throwExc();
304         return 0;
305     }
306
307     public int getPass2FieldNos(int[] buf) {
308         throwExc();
309         return 0;
310     }
311
312     public short getShortField(int stateFieldNo) {
313         throwExc();
314         return 0;
315     }
316
317     public short getShortFieldAbs(int absFieldNo) {
318         throwExc();
319         return 0;
320     }
321
322     public String JavaDoc getStringField(int stateFieldNo) {
323         throwExc();
324         return null;
325     }
326
327     public String JavaDoc getStringFieldAbs(int absFieldNo) {
328         throwExc();
329         return null;
330     }
331
332     public String JavaDoc getVersion() {
333         throwExc();
334         return null;
335     }
336
337     public boolean hasSameFields(State state) {
338         throwExc();
339         return false;
340     }
341
342     public boolean hasSameNullFields(State state, State mask) {
343         throwExc();
344         return false;
345     }
346
347     public boolean isDirty() {
348         throwExc();
349         return false;
350     }
351
352     public boolean isDirty(int fieldNo) {
353         throwExc();
354         return false;
355     }
356
357     public boolean isEmpty() {
358         throwExc();
359         return false;
360     }
361
362     public boolean isHollow() {
363         throwExc();
364         return false;
365     }
366
367     public boolean isNull(int stateFieldNo) {
368         throwExc();
369         return false;
370     }
371
372     public void makeClean() {
373         throwExc();
374     }
375
376     public void makeDirtyAbs(int fieldNo) {
377         throwExc();
378     }
379
380     public State newInstance() {
381         throwExc();
382         return null;
383     }
384
385     public boolean replaceNewObjectOIDs(int[] fieldNos, int fieldNosLength) {
386         throwExc();
387         return false;
388     }
389
390     public int replaceSCOFields(PersistenceCapable owner,
391             VersantPersistenceManagerImp sm, int[] absFieldNos) {
392         throwExc();
393         return 0;
394     }
395
396     public void retrieve(VersantPersistenceManagerImp sm) {
397         throwExc();
398     }
399
400     public void setBooleanField(int stateFieldNo, boolean newValue) {
401         throwExc();
402     }
403
404     public void setBooleanFieldAbs(int absFieldNo, boolean newValue) {
405         throwExc();
406     }
407
408     public void setByteField(int stateFieldNo, byte newValue) {
409         throwExc();
410     }
411
412     public void setByteFieldAbs(int absFieldNo, byte newValue) {
413         throwExc();
414     }
415
416     public void setCharField(int stateFieldNo, char newValue) {
417         throwExc();
418     }
419
420     public void setCharFieldAbs(int absFieldNo, char newValue) {
421         throwExc();
422     }
423
424     public void setClassMetaData(ClassMetaData cmd) {
425         throwExc();
426     }
427
428     public void setDoubleField(int stateFieldNo, double newValue) {
429         throwExc();
430     }
431
432     public void setDoubleFieldAbs(int absFieldNo, double newValue) {
433         throwExc();
434     }
435
436     public void setFloatField(int stateFieldNo, float newValue) {
437         throwExc();
438     }
439
440     public void setFloatFieldAbs(int absFieldNo, float newValue) {
441         throwExc();
442     }
443
444     public void setInternalBooleanField(int field, boolean newValue) {
445         throwExc();
446     }
447
448     public void setInternalBooleanFieldAbs(int field, boolean newValue) {
449         throwExc();
450     }
451
452     public void setInternalByteField(int field, byte newValue) {
453         throwExc();
454     }
455
456     public void setInternalByteFieldAbs(int field, byte newValue) {
457         throwExc();
458     }
459
460     public void setInternalCharField(int field, char newValue) {
461         throwExc();
462     }
463
464     public void setInternalCharFieldAbs(int field, char newValue) {
465         throwExc();
466     }
467
468     public void setInternalDoubleField(int field, double newValue) {
469         throwExc();
470     }
471
472     public void setInternalDoubleFieldAbs(int field, double newValue) {
473         throwExc();
474     }
475
476     public void setInternalFloatField(int field, float newValue) {
477         throwExc();
478     }
479
480     public void setInternalFloatFieldAbs(int field, float newValue) {
481         throwExc();
482     }
483
484     public void setInternalIntField(int field, int newValue) {
485         throwExc();
486     }
487
488     public void setInternalIntFieldAbs(int field, int newValue) {
489         throwExc();
490     }
491
492     public void setInternalLongField(int field, long newValue) {
493         throwExc();
494     }
495
496     public void setInternalLongFieldAbs(int field, long newValue) {
497         throwExc();
498     }
499
500     public void setInternalObjectField(int field, Object JavaDoc newValue) {
501         throwExc();
502     }
503
504     public void setInternalObjectFieldAbs(int field, Object JavaDoc newValue) {
505         throwExc();
506     }
507
508     public void setInternalShortField(int field, short newValue) {
509         throwExc();
510     }
511
512     public void setInternalShortFieldAbs(int field, short newValue) {
513         throwExc();
514     }
515
516     public void setInternalStringField(int field, String JavaDoc newValue) {
517         throwExc();
518     }
519
520     public void setInternalStringFieldAbs(int field, String JavaDoc newValue) {
521         throwExc();
522     }
523
524     public void setIntField(int stateFieldNo, int newValue) {
525         throwExc();
526     }
527
528     public void setIntFieldAbs(int absFieldNo, int newValue) {
529         throwExc();
530     }
531
532     public void setLongField(int stateFieldNo, long newValue) {
533         throwExc();
534     }
535
536     public void setLongFieldAbs(int absFieldNo, long newValue) {
537         throwExc();
538     }
539
540     public void setObjectField(int stateFieldNo, Object JavaDoc newValue) {
541         throwExc();
542     }
543
544     public void setObjectFieldAbs(int absFieldNo, Object JavaDoc newValue) {
545         throwExc();
546     }
547
548     public void setObjectFieldUnresolved(int field, Object JavaDoc newValue) {
549         throwExc();
550     }
551
552     public void setObjectFieldUnresolvedAbs(int field, Object JavaDoc newValue) {
553         throwExc();
554     }
555
556     public void setShortField(int stateFieldNo, short newValue) {
557         throwExc();
558     }
559
560     public void setShortFieldAbs(int absFieldNo, short newValue) {
561         throwExc();
562     }
563
564     public void setStringField(int stateFieldNo, String JavaDoc newValue) {
565         throwExc();
566     }
567
568     public void setStringFieldAbs(int absFieldNo, String JavaDoc newValue) {
569         throwExc();
570     }
571
572     public void unmanageSCOFields() {
573         throwExc();
574     }
575
576     public void updateAutoSetFieldsCreated(Date JavaDoc now) {
577         throwExc();
578     }
579
580     public void updateAutoSetFieldsModified(Date JavaDoc now, State oldState) {
581         throwExc();
582     }
583
584     public void updateFrom(State state) {
585         throwExc();
586     }
587
588     public void updateNonFilled(State state) {
589         throwExc();
590     }
591
592     public void readExternal(ObjectInput in) {
593         throwExc();
594     }
595
596     public void writeExternal(ObjectOutput out) {
597         throwExc();
598     }
599
600     /**
601      * Add all states referenced by fields in fg to the dcs.
602      */

603     public void addFetchGroupStatesToDCS(FetchGroup fg,
604             DetachStateContainer dcs, VersantPersistenceManagerImp pm,
605             OID oid) {
606         throwExc();
607     }
608
609     public boolean isResolvedForClient(int stateFieldNo) {
610         throwExc();
611         return false;
612     }
613
614     public Object JavaDoc getOptimisticLockingValue() {
615         throwExc();
616         return null;
617     }
618
619     public void setFilled(int field) {
620         throwExc();
621     }
622
623     public void fillForRead(State dest,
624             VersantPersistenceManagerImp sm) {
625         throwExc();
626     }
627
628     public void clearFilledFlags() {
629         throwExc();
630     }
631
632     public void addOneToManyInverseFieldsForL2Evict(
633             VersantPersistenceManagerImp pm) {
634         throwExc();
635     }
636
637     public int getPass1FieldRefFieldNosWithNewOids(int[] stateFieldNoBuf) {
638         throwExc();
639         return 0;
640     }
641
642     public void writeExternal(OIDObjectOutput os) throws IOException JavaDoc {
643         throwExc();
644     }
645
646     public void readExternal(OIDObjectInput is) throws IOException JavaDoc,
647             ClassNotFoundException JavaDoc {
648         throwExc();
649     }
650 }
651
Popular Tags