KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > dynamicany > DynAnyConstructedImpl


1 /*
2  * @(#)DynAnyConstructedImpl.java 1.9 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.dynamicany;
9
10 import org.omg.CORBA.Any JavaDoc;
11 import org.omg.CORBA.TypeCode JavaDoc;
12 import org.omg.CORBA.portable.OutputStream JavaDoc;
13 import org.omg.DynamicAny.*;
14 import org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc;
15 import org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc;
16 import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode JavaDoc;
17 import com.sun.corba.se.impl.corba.TypeCodeImpl; // needed for recursive type codes
18

19 import com.sun.corba.se.spi.orb.ORB ;
20 import com.sun.corba.se.spi.logging.CORBALogDomains ;
21 import com.sun.corba.se.impl.logging.ORBUtilSystemException ;
22
23 abstract class DynAnyConstructedImpl extends DynAnyImpl
24 {
25     protected static final byte REPRESENTATION_NONE = 0;
26     protected static final byte REPRESENTATION_TYPECODE = 1;
27     protected static final byte REPRESENTATION_ANY = 2;
28     protected static final byte REPRESENTATION_COMPONENTS = 4;
29
30     protected static final byte RECURSIVE_UNDEF = -1;
31     protected static final byte RECURSIVE_NO = 0;
32     protected static final byte RECURSIVE_YES = 1;
33
34     protected static final DynAny[] emptyComponents = new DynAny[0];
35     //
36
// Instance variables
37
//
38

39     // Constructed DynAnys maintain an ordered collection of component DynAnys.
40
DynAny[] components = emptyComponents;
41     byte representations = REPRESENTATION_NONE;
42     byte isRecursive = RECURSIVE_UNDEF;
43
44     //
45
// Constructors
46
//
47

48     private DynAnyConstructedImpl() {
49         this(null, (Any JavaDoc)null, false);
50     }
51
52     protected DynAnyConstructedImpl(ORB orb, Any JavaDoc any, boolean copyValue) {
53         super(orb, any, copyValue);
54         //System.out.println(this + " constructed with any " + any);
55
if (this.any != null) {
56             representations = REPRESENTATION_ANY;
57         }
58         // set the current position to 0 if any has components, otherwise to -1.
59
index = 0;
60     }
61
62     protected DynAnyConstructedImpl(ORB orb, TypeCode JavaDoc typeCode) {
63         // assertion: typeCode has been checked to be valid for this particular subclass.
64
// note: We don't copy TypeCodes since they are considered immutable.
65
super(orb, typeCode);
66         if (typeCode != null) {
67             representations = REPRESENTATION_TYPECODE;
68         }
69         // set the current position to 0 if any has components, otherwise to -1.
70
index = NO_INDEX;
71
72         // _REVISIT_ Would need REPRESENTATION_TYPECODE for lazy initialization
73
//if ( ! isRecursive()) {
74
// initializeComponentsFromTypeCode();
75
//}
76
}
77
78     protected boolean isRecursive() {
79         if (isRecursive == RECURSIVE_UNDEF) {
80             TypeCode JavaDoc typeCode = any.type();
81             if (typeCode instanceof TypeCodeImpl) {
82                 if (((TypeCodeImpl)typeCode).is_recursive())
83                     isRecursive = RECURSIVE_YES;
84                 else
85                     isRecursive = RECURSIVE_NO;
86             } else {
87                 // No way to find out unless the TypeCode spec changes.
88
isRecursive = RECURSIVE_NO;
89             }
90         }
91         return (isRecursive == RECURSIVE_YES);
92     }
93
94     //
95
// DynAny traversal methods
96
//
97

98     public org.omg.DynamicAny.DynAny JavaDoc current_component()
99         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc
100     {
101         if (status == STATUS_DESTROYED) {
102         throw wrapper.dynAnyDestroyed() ;
103         }
104         if (index == NO_INDEX) {
105             return null;
106         }
107         return (checkInitComponents() ? components[index] : null);
108     }
109
110     public int component_count() {
111         if (status == STATUS_DESTROYED) {
112         throw wrapper.dynAnyDestroyed() ;
113         }
114         return (checkInitComponents() ? components.length : 0);
115     }
116
117     public boolean next() {
118         if (status == STATUS_DESTROYED) {
119         throw wrapper.dynAnyDestroyed() ;
120         }
121         if (checkInitComponents() == false) {
122             return false;
123         }
124         index++;
125         if (index >= 0 && index < components.length) {
126             return true;
127         } else {
128             index = NO_INDEX;
129             return false;
130         }
131     }
132
133     public boolean seek(int newIndex) {
134         if (status == STATUS_DESTROYED) {
135         throw wrapper.dynAnyDestroyed() ;
136         }
137         if (newIndex < 0) {
138             this.index = NO_INDEX;
139             return false;
140         }
141         if (checkInitComponents() == false) {
142             return false;
143         }
144         if (newIndex < components.length) {
145             index = newIndex;
146             return true;
147         }
148         return false;
149     }
150
151     public void rewind() {
152         if (status == STATUS_DESTROYED) {
153         throw wrapper.dynAnyDestroyed() ;
154         }
155         this.seek(0);
156     }
157
158     //
159
// Utility methods
160
//
161

162     protected void clearData() {
163         super.clearData();
164         // _REVISIT_ What about status?
165
components = emptyComponents;
166         index = NO_INDEX;
167         representations = REPRESENTATION_NONE;
168     }
169
170     protected void writeAny(OutputStream JavaDoc out) {
171         // If all we got is TypeCode representation (no value)
172
// then we don't want to force creating a default value
173
//System.out.println(this + " checkInitAny before writeAny");
174
checkInitAny();
175         super.writeAny(out);
176     }
177
178     // Makes sure that the components representation is initialized
179
protected boolean checkInitComponents() {
180         if ((representations & REPRESENTATION_COMPONENTS) == 0) {
181             if ((representations & REPRESENTATION_ANY) != 0) {
182                 if (initializeComponentsFromAny()) {
183                     representations |= REPRESENTATION_COMPONENTS;
184                 } else {
185                     return false;
186                 }
187             } else if ((representations & REPRESENTATION_TYPECODE) != 0) {
188                 if (initializeComponentsFromTypeCode()) {
189                     representations |= REPRESENTATION_COMPONENTS;
190                 } else {
191                     return false;
192                 }
193             }
194         }
195         return true;
196     }
197
198     // Makes sure that the Any representation is initialized
199
protected void checkInitAny() {
200         if ((representations & REPRESENTATION_ANY) == 0) {
201             //System.out.println(this + " checkInitAny: reps does not have REPRESENTATION_ANY");
202
if ((representations & REPRESENTATION_COMPONENTS) != 0) {
203                 //System.out.println(this + " checkInitAny: reps has REPRESENTATION_COMPONENTS");
204
if (initializeAnyFromComponents()) {
205                     representations |= REPRESENTATION_ANY;
206                 }
207             } else if ((representations & REPRESENTATION_TYPECODE) != 0) {
208                 //System.out.println(this + " checkInitAny: reps has REPRESENTATION_TYPECODE");
209
if (representations == REPRESENTATION_TYPECODE && isRecursive())
210                     return;
211                 if (initializeComponentsFromTypeCode()) {
212                     representations |= REPRESENTATION_COMPONENTS;
213                 }
214                 if (initializeAnyFromComponents()) {
215                     representations |= REPRESENTATION_ANY;
216                 }
217             }
218         } else {
219             //System.out.println(this + " checkInitAny: reps != REPRESENTATION_ANY");
220
}
221         return;
222     }
223
224     protected abstract boolean initializeComponentsFromAny();
225     protected abstract boolean initializeComponentsFromTypeCode();
226
227     // Collapses the whole DynAny hierarchys values into one single streamed Any
228
protected boolean initializeAnyFromComponents() {
229         //System.out.println(this + " initializeAnyFromComponents");
230
OutputStream JavaDoc out = any.create_output_stream();
231         for (int i=0; i<components.length; i++) {
232             if (components[i] instanceof DynAnyImpl) {
233                 ((DynAnyImpl)components[i]).writeAny(out);
234             } else {
235                 // Not our implementation. Nothing we can do to prevent copying.
236
components[i].to_any().write_value(out);
237             }
238         }
239         any.read_value(out.create_input_stream(), any.type());
240         return true;
241     }
242
243     //
244
// DynAny interface methods
245
//
246

247     public void assign (org.omg.DynamicAny.DynAny JavaDoc dyn_any)
248         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc
249     {
250         if (status == STATUS_DESTROYED) {
251         throw wrapper.dynAnyDestroyed() ;
252         }
253         clearData();
254         super.assign(dyn_any);
255         representations = REPRESENTATION_ANY;
256         index = 0;
257     }
258
259     public void from_any (org.omg.CORBA.Any JavaDoc value)
260         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
261                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
262     {
263         if (status == STATUS_DESTROYED) {
264         throw wrapper.dynAnyDestroyed() ;
265         }
266         clearData();
267         super.from_any(value);
268         representations = REPRESENTATION_ANY;
269         index = 0;
270     }
271
272     // Spec: Returns a copy of the internal Any
273
public org.omg.CORBA.Any JavaDoc to_any() {
274         //System.out.println(this + " to_any ");
275
if (status == STATUS_DESTROYED) {
276         throw wrapper.dynAnyDestroyed() ;
277         }
278     checkInitAny();
279         // Anys value may still be uninitialized if DynAny was initialized by TypeCode only
280
return DynAnyUtil.copy(any, orb);
281     }
282
283     public boolean equal (org.omg.DynamicAny.DynAny JavaDoc dyn_any) {
284         if (status == STATUS_DESTROYED) {
285         throw wrapper.dynAnyDestroyed() ;
286         }
287         if (dyn_any == this) {
288             return true;
289         }
290         if ( ! any.type().equal(dyn_any.type())) {
291             return false;
292         }
293         // This changes the current position of dyn_any.
294
// Make sure that our position isn't changed.
295
if (checkInitComponents() == false) {
296             return false;
297         }
298         DynAny currentComponent = null;
299         try {
300             // Remember the current position to restore it later
301
currentComponent = dyn_any.current_component();
302             for (int i=0; i<components.length; i++) {
303                 if (dyn_any.seek(i) == false)
304                     return false;
305                 //System.out.println(this + " comparing component " + i + "=" + components[i] +
306
// " of type " + components[i].type().kind().value());
307
if ( ! components[i].equal(dyn_any.current_component())) {
308                     //System.out.println("Not equal component " + i);
309
return false;
310                 }
311             }
312         } catch (TypeMismatch JavaDoc tm) {
313             // impossible, we checked the type codes already
314
} finally {
315             // Restore the current position of the other DynAny
316
DynAnyUtil.set_current_component(dyn_any, currentComponent);
317         }
318         return true;
319     }
320
321     public void destroy() {
322         if (status == STATUS_DESTROYED) {
323         throw wrapper.dynAnyDestroyed() ;
324         }
325         if (status == STATUS_DESTROYABLE) {
326             status = STATUS_DESTROYED;
327             for (int i=0; i<components.length; i++) {
328                 if (components[i] instanceof DynAnyImpl) {
329                     ((DynAnyImpl)components[i]).setStatus(STATUS_DESTROYABLE);
330                 }
331                 components[i].destroy();
332             }
333         }
334     }
335
336     public org.omg.DynamicAny.DynAny JavaDoc copy() {
337         if (status == STATUS_DESTROYED) {
338         throw wrapper.dynAnyDestroyed() ;
339         }
340         checkInitAny();
341         try {
342             return DynAnyUtil.createMostDerivedDynAny(any, orb, true);
343         } catch (InconsistentTypeCode JavaDoc ictc) {
344             return null; // impossible
345
}
346     }
347
348     // getter / setter methods
349

350     public void insert_boolean(boolean value)
351         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
352                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
353     {
354         if (status == STATUS_DESTROYED) {
355         throw wrapper.dynAnyDestroyed() ;
356         }
357     if (index == NO_INDEX)
358             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
359         DynAny currentComponent = current_component();
360         if (DynAnyUtil.isConstructedDynAny(currentComponent))
361             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
362         currentComponent.insert_boolean(value);
363     }
364
365     public void insert_octet(byte value)
366         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
367                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
368     {
369         if (status == STATUS_DESTROYED) {
370         throw wrapper.dynAnyDestroyed() ;
371         }
372     if (index == NO_INDEX)
373             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
374         DynAny currentComponent = current_component();
375         if (DynAnyUtil.isConstructedDynAny(currentComponent))
376             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
377         currentComponent.insert_octet(value);
378     }
379
380     public void insert_char(char value)
381         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
382                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
383     {
384         if (status == STATUS_DESTROYED) {
385         throw wrapper.dynAnyDestroyed() ;
386         }
387     if (index == NO_INDEX)
388             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
389         DynAny currentComponent = current_component();
390         if (DynAnyUtil.isConstructedDynAny(currentComponent))
391             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
392         currentComponent.insert_char(value);
393     }
394
395     public void insert_short(short value)
396         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
397                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
398     {
399         if (status == STATUS_DESTROYED) {
400         throw wrapper.dynAnyDestroyed() ;
401         }
402     if (index == NO_INDEX)
403             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
404         DynAny currentComponent = current_component();
405         if (DynAnyUtil.isConstructedDynAny(currentComponent))
406             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
407         currentComponent.insert_short(value);
408     }
409
410     public void insert_ushort(short value)
411         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
412                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
413     {
414         if (status == STATUS_DESTROYED) {
415         throw wrapper.dynAnyDestroyed() ;
416         }
417     if (index == NO_INDEX)
418             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
419         DynAny currentComponent = current_component();
420         if (DynAnyUtil.isConstructedDynAny(currentComponent))
421             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
422         currentComponent.insert_ushort(value);
423     }
424
425     public void insert_long(int value)
426         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
427                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
428     {
429         if (status == STATUS_DESTROYED) {
430         throw wrapper.dynAnyDestroyed() ;
431         }
432     if (index == NO_INDEX)
433             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
434         DynAny currentComponent = current_component();
435         if (DynAnyUtil.isConstructedDynAny(currentComponent))
436             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
437         currentComponent.insert_long(value);
438     }
439
440     public void insert_ulong(int value)
441         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
442                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
443     {
444         if (status == STATUS_DESTROYED) {
445         throw wrapper.dynAnyDestroyed() ;
446         }
447     if (index == NO_INDEX)
448             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
449         DynAny currentComponent = current_component();
450         if (DynAnyUtil.isConstructedDynAny(currentComponent))
451             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
452         currentComponent.insert_ulong(value);
453     }
454
455     public void insert_float(float value)
456         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
457                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
458     {
459         if (status == STATUS_DESTROYED) {
460         throw wrapper.dynAnyDestroyed() ;
461         }
462     if (index == NO_INDEX)
463             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
464         DynAny currentComponent = current_component();
465         if (DynAnyUtil.isConstructedDynAny(currentComponent))
466             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
467         currentComponent.insert_float(value);
468     }
469
470     public void insert_double(double value)
471         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
472                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
473     {
474         if (status == STATUS_DESTROYED) {
475         throw wrapper.dynAnyDestroyed() ;
476         }
477     if (index == NO_INDEX)
478             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
479         DynAny currentComponent = current_component();
480         if (DynAnyUtil.isConstructedDynAny(currentComponent))
481             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
482         currentComponent.insert_double(value);
483     }
484
485     public void insert_string(String JavaDoc value)
486         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
487                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
488     {
489         if (status == STATUS_DESTROYED) {
490         throw wrapper.dynAnyDestroyed() ;
491         }
492     if (index == NO_INDEX)
493             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
494         DynAny currentComponent = current_component();
495         if (DynAnyUtil.isConstructedDynAny(currentComponent))
496             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
497         currentComponent.insert_string(value);
498     }
499
500     public void insert_reference(org.omg.CORBA.Object JavaDoc value)
501         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
502                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
503     {
504         if (status == STATUS_DESTROYED) {
505         throw wrapper.dynAnyDestroyed() ;
506         }
507     if (index == NO_INDEX)
508             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
509         DynAny currentComponent = current_component();
510         if (DynAnyUtil.isConstructedDynAny(currentComponent))
511             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
512         currentComponent.insert_reference(value);
513     }
514
515     public void insert_typecode(org.omg.CORBA.TypeCode JavaDoc value)
516         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
517                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
518     {
519         if (status == STATUS_DESTROYED) {
520         throw wrapper.dynAnyDestroyed() ;
521         }
522     if (index == NO_INDEX)
523             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
524         DynAny currentComponent = current_component();
525         if (DynAnyUtil.isConstructedDynAny(currentComponent))
526             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
527         currentComponent.insert_typecode(value);
528     }
529
530     public void insert_longlong(long value)
531         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
532                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
533     {
534         if (status == STATUS_DESTROYED) {
535         throw wrapper.dynAnyDestroyed() ;
536         }
537     if (index == NO_INDEX)
538             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
539         DynAny currentComponent = current_component();
540         if (DynAnyUtil.isConstructedDynAny(currentComponent))
541             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
542         currentComponent.insert_longlong(value);
543     }
544
545     public void insert_ulonglong(long value)
546         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
547                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
548     {
549         if (status == STATUS_DESTROYED) {
550         throw wrapper.dynAnyDestroyed() ;
551         }
552     if (index == NO_INDEX)
553             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
554         DynAny currentComponent = current_component();
555         if (DynAnyUtil.isConstructedDynAny(currentComponent))
556             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
557         currentComponent.insert_ulonglong(value);
558     }
559
560     public void insert_wchar(char value)
561         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
562                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
563     {
564         if (status == STATUS_DESTROYED) {
565         throw wrapper.dynAnyDestroyed() ;
566         }
567     if (index == NO_INDEX)
568             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
569         DynAny currentComponent = current_component();
570         if (DynAnyUtil.isConstructedDynAny(currentComponent))
571             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
572         currentComponent.insert_wchar(value);
573     }
574
575     public void insert_wstring(String JavaDoc value)
576         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
577                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
578     {
579         if (status == STATUS_DESTROYED) {
580         throw wrapper.dynAnyDestroyed() ;
581         }
582     if (index == NO_INDEX)
583             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
584         DynAny currentComponent = current_component();
585         if (DynAnyUtil.isConstructedDynAny(currentComponent))
586             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
587         currentComponent.insert_wstring(value);
588     }
589
590     public void insert_any(org.omg.CORBA.Any JavaDoc value)
591         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
592                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
593     {
594         if (status == STATUS_DESTROYED) {
595         throw wrapper.dynAnyDestroyed() ;
596         }
597     if (index == NO_INDEX)
598             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
599         DynAny currentComponent = current_component();
600         if (DynAnyUtil.isConstructedDynAny(currentComponent))
601             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
602         currentComponent.insert_any(value);
603     }
604
605     public void insert_dyn_any (org.omg.DynamicAny.DynAny JavaDoc value)
606         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
607                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
608     {
609         if (status == STATUS_DESTROYED) {
610         throw wrapper.dynAnyDestroyed() ;
611         }
612     if (index == NO_INDEX)
613             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
614         DynAny currentComponent = current_component();
615         if (DynAnyUtil.isConstructedDynAny(currentComponent))
616             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
617         currentComponent.insert_dyn_any(value);
618     }
619     
620     public void insert_val(java.io.Serializable JavaDoc value)
621         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
622                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
623     {
624         if (status == STATUS_DESTROYED) {
625         throw wrapper.dynAnyDestroyed() ;
626         }
627     if (index == NO_INDEX)
628             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
629         DynAny currentComponent = current_component();
630         if (DynAnyUtil.isConstructedDynAny(currentComponent))
631             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
632         currentComponent.insert_val(value);
633     }
634
635     public java.io.Serializable JavaDoc get_val()
636         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
637                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
638     {
639         if (status == STATUS_DESTROYED) {
640         throw wrapper.dynAnyDestroyed() ;
641         }
642     if (index == NO_INDEX)
643             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
644         DynAny currentComponent = current_component();
645         if (DynAnyUtil.isConstructedDynAny(currentComponent))
646             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
647         return currentComponent.get_val();
648     }
649
650     public boolean get_boolean()
651         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
652                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
653     {
654         if (status == STATUS_DESTROYED) {
655         throw wrapper.dynAnyDestroyed() ;
656         }
657     if (index == NO_INDEX)
658             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
659         DynAny currentComponent = current_component();
660         if (DynAnyUtil.isConstructedDynAny(currentComponent))
661             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
662         return currentComponent.get_boolean();
663     }
664
665     public byte get_octet()
666         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
667                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
668     {
669         if (status == STATUS_DESTROYED) {
670         throw wrapper.dynAnyDestroyed() ;
671         }
672     if (index == NO_INDEX)
673             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
674         DynAny currentComponent = current_component();
675         if (DynAnyUtil.isConstructedDynAny(currentComponent))
676             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
677         return currentComponent.get_octet();
678     }
679
680     public char get_char()
681         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
682                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
683     {
684         if (status == STATUS_DESTROYED) {
685         throw wrapper.dynAnyDestroyed() ;
686         }
687     if (index == NO_INDEX)
688             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
689         DynAny currentComponent = current_component();
690         if (DynAnyUtil.isConstructedDynAny(currentComponent))
691             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
692         return currentComponent.get_char();
693     }
694
695     public short get_short()
696         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
697                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
698     {
699         if (status == STATUS_DESTROYED) {
700         throw wrapper.dynAnyDestroyed() ;
701         }
702     if (index == NO_INDEX)
703             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
704         DynAny currentComponent = current_component();
705         if (DynAnyUtil.isConstructedDynAny(currentComponent))
706             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
707         return currentComponent.get_short();
708     }
709
710     public short get_ushort()
711         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
712                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
713     {
714         if (status == STATUS_DESTROYED) {
715         throw wrapper.dynAnyDestroyed() ;
716         }
717     if (index == NO_INDEX)
718             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
719         DynAny currentComponent = current_component();
720         if (DynAnyUtil.isConstructedDynAny(currentComponent))
721             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
722         return currentComponent.get_ushort();
723     }
724
725     public int get_long()
726         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
727                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
728     {
729         if (status == STATUS_DESTROYED) {
730         throw wrapper.dynAnyDestroyed() ;
731         }
732     if (index == NO_INDEX)
733             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
734         DynAny currentComponent = current_component();
735         if (DynAnyUtil.isConstructedDynAny(currentComponent))
736             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
737         return currentComponent.get_long();
738     }
739
740     public int get_ulong()
741         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
742                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
743     {
744         if (status == STATUS_DESTROYED) {
745         throw wrapper.dynAnyDestroyed() ;
746         }
747     if (index == NO_INDEX)
748             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
749         DynAny currentComponent = current_component();
750         if (DynAnyUtil.isConstructedDynAny(currentComponent))
751             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
752         return currentComponent.get_ulong();
753     }
754
755     public float get_float()
756         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
757                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
758     {
759         if (status == STATUS_DESTROYED) {
760         throw wrapper.dynAnyDestroyed() ;
761         }
762     if (index == NO_INDEX)
763             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
764         DynAny currentComponent = current_component();
765         if (DynAnyUtil.isConstructedDynAny(currentComponent))
766             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
767         return currentComponent.get_float();
768     }
769
770     public double get_double()
771         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
772                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
773     {
774         if (status == STATUS_DESTROYED) {
775         throw wrapper.dynAnyDestroyed() ;
776         }
777     if (index == NO_INDEX)
778             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
779         DynAny currentComponent = current_component();
780         if (DynAnyUtil.isConstructedDynAny(currentComponent))
781             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
782         return currentComponent.get_double();
783     }
784
785     public String JavaDoc get_string()
786         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
787                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
788     {
789         if (status == STATUS_DESTROYED) {
790         throw wrapper.dynAnyDestroyed() ;
791         }
792     if (index == NO_INDEX)
793             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
794         DynAny currentComponent = current_component();
795         if (DynAnyUtil.isConstructedDynAny(currentComponent))
796             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
797         return currentComponent.get_string();
798     }
799
800     public org.omg.CORBA.Object JavaDoc get_reference()
801         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
802                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
803     {
804         if (status == STATUS_DESTROYED) {
805         throw wrapper.dynAnyDestroyed() ;
806         }
807     if (index == NO_INDEX)
808             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
809         DynAny currentComponent = current_component();
810         if (DynAnyUtil.isConstructedDynAny(currentComponent))
811             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
812         return currentComponent.get_reference();
813     }
814
815     public org.omg.CORBA.TypeCode JavaDoc get_typecode()
816         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
817                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
818     {
819         if (status == STATUS_DESTROYED) {
820         throw wrapper.dynAnyDestroyed() ;
821         }
822     if (index == NO_INDEX)
823             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
824         DynAny currentComponent = current_component();
825         if (DynAnyUtil.isConstructedDynAny(currentComponent))
826             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
827         return currentComponent.get_typecode();
828     }
829
830     public long get_longlong()
831         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
832                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
833     {
834         if (status == STATUS_DESTROYED) {
835         throw wrapper.dynAnyDestroyed() ;
836         }
837     if (index == NO_INDEX)
838             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
839         DynAny currentComponent = current_component();
840         if (DynAnyUtil.isConstructedDynAny(currentComponent))
841             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
842         return currentComponent.get_longlong();
843     }
844
845     public long get_ulonglong()
846         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
847                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
848     {
849         if (status == STATUS_DESTROYED) {
850         throw wrapper.dynAnyDestroyed() ;
851         }
852     if (index == NO_INDEX)
853             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
854         DynAny currentComponent = current_component();
855         if (DynAnyUtil.isConstructedDynAny(currentComponent))
856             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
857         return currentComponent.get_ulonglong();
858     }
859
860     public char get_wchar()
861         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
862                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
863     {
864         if (status == STATUS_DESTROYED) {
865         throw wrapper.dynAnyDestroyed() ;
866         }
867     if (index == NO_INDEX)
868             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
869         DynAny currentComponent = current_component();
870         if (DynAnyUtil.isConstructedDynAny(currentComponent))
871             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
872         return currentComponent.get_wchar();
873     }
874
875     public String JavaDoc get_wstring()
876         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
877                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
878     {
879         if (status == STATUS_DESTROYED) {
880         throw wrapper.dynAnyDestroyed() ;
881         }
882     if (index == NO_INDEX)
883             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
884         DynAny currentComponent = current_component();
885         if (DynAnyUtil.isConstructedDynAny(currentComponent))
886             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
887         return currentComponent.get_wstring();
888     }
889
890     public org.omg.CORBA.Any JavaDoc get_any()
891         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
892                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
893     {
894         if (status == STATUS_DESTROYED) {
895         throw wrapper.dynAnyDestroyed() ;
896         }
897     if (index == NO_INDEX)
898             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
899         DynAny currentComponent = current_component();
900         if (DynAnyUtil.isConstructedDynAny(currentComponent))
901             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
902         return currentComponent.get_any();
903     }
904
905     public org.omg.DynamicAny.DynAny JavaDoc get_dyn_any()
906         throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc,
907                org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc
908     {
909         if (status == STATUS_DESTROYED) {
910         throw wrapper.dynAnyDestroyed() ;
911         }
912     if (index == NO_INDEX)
913             throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue JavaDoc();
914         DynAny currentComponent = current_component();
915         if (DynAnyUtil.isConstructedDynAny(currentComponent))
916             throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch JavaDoc();
917         return currentComponent.get_dyn_any();
918     }
919 }
920
Popular Tags