API Overview API Index Package Overview Direct link to this page
JDK 1.6
  org.omg.CORBA. TypeCode View Javadoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516

/*
 * @(#)TypeCode.java	1.51 03/01/23
 *
 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

package org.omg.CORBA;

import org.omg.CORBA.TypeCodePackage.*;
import org.omg.CORBA.portable.IDLEntity;

/**
 * A container for information about a specific CORBA data
 * type.
 *<P>
 * <code>TypeCode</code> objects are used:
 * <UL>
 * <LI>in the Dynamic Invocation Interface -- to indicate the types
 * of the actual arguments or the type of the return value.  <BR>
 * <code>NamedValue</code> objects are used to represent arguments and
 * return values.  One of their components is an <code>Any</code>
 * object, which in turn has as one of its components a
 * <code>TypeCode</code> object.
 * <LI>by an Interface Repository to represent the type specifications
 * that are part of many OMG IDL declarations
 * </UL>
 * <P>
 * The representation of a <code>TypeCode</code> object is opaque,
 * but abstractly, a <code>TypeCode</code> object consists of:
 * <UL>
 * <LI>a <code>kind</code> field, which is set to an instance
 * of the class <code>TCKind</code>
 * <LI>zero or more additional fields appropriate
 * for the particular kind. For example, the
 * <code>TypeCode</code> object
 * describing the OMG IDL type <code>1ong</code> has kind
 * <code>TCKind.tk_long</code> and no additional fields.
 * The <code>TypeCode</code> describing OMG IDL type
 * <code>sequence&lt;boolean, 10&gt;</code> has a <code>kind</code> field
 * with the value
 * <code>TCKind.tk_sequence</code> and also fields with the values
 * <code>boolean</code> and <code>10</code> for the
 * type of sequence elements and the length of the sequence. <p>
 * </UL>
 *
 * <code>TypeCode</code> objects can be obtained in various ways:
 * <OL>
 * <LI>from a call to the method <code>Any.insert_X</code>, where X is
 * a basic IDL type.  This method creates a <code>TypeCode</code> object
 * for type X and assigns it to the <code>Any</code> object's
 * <code>type</code> field.
 * <LI>from invocations of methods in the ORB class
 * <P>For example, the following creates a <code>TypeCode</code>
 * object for a <code>string</code> with a maximum of 30 characters:
 * <PRE>
 *   org.omg.CORBA.TypeCode tcString = orb.create_string_tc(30);
 * </PRE>
 * <P> The following creates a <code>TypeCode</code>
 * object for an <code>array</code> of five <code>string</code>s:
 * <PRE>
 *   org.omg.CORBA.TypeCode tcArray = orb.create_array_tc(
 *                                       5, TCKind.tk_string);
 * </PRE>
 * <P> The following creates a <code>TypeCode</code>
 * object for an interface named "Account":
 * <PRE>
 *   org.omg.CORBA.TypeCode tcInterface = orb.create_interface_tc(
 *                                                 "thisId", "Account");
 * </PRE>
 * <LI>as the return value from the <code>_type</code> method
 * in <code>Holder</code> classes for user-defined
 * IDL types.  These <code>Holder</code> classes are generated
 * by the <code>idltojava</code> compiler.
 * <LI>from a CORBA Interface Repository
 * </OL>
 * <P>
 * Most of the methods in the class <code>TypeCode</code>
 * are accessors, and the information contained in a <code>TypeCode</code>
 * object is specific to a particular type.  Therefore, methods
 * must be invoked
 * only on the kind of type codes to which they apply.  If an
 * accessor method
 * tries to access information from an inappropriate kind of
 * type code, it will throw
 * the exception <code>TypeCodePackage.BadKind</code>.  For example,
 * if the method <code>discriminator_type</code> is called on anything
 * other than a <code>union</code>, it will throw <code>BadKind</code>
 * because only <code>union</code>s have a discriminator.
 * The following list shows which methods apply to which kinds of
 * type codes:
 * <P>
 * These methods may be invoked on all <code>TypeCode</code> kinds:
 * <UL>
 * <LI><code>equal</code>
 * <LI><code>kind</code>
 * </UL>
 * <P>
 * These methods may be invoked on <code>objref</code>, <code>struct</code>,
 * <code>union</code>, <code>enum</code>,
 * <code>alias</code>, <code>exception</code>, <code>value</code>,
 * <code>value_box</code>, <code>native</code>, 
 * and <code>abstract_interface</code>:
 * <UL>
 * <LI><code>id</code>
 * <LI><code>name</code>
 * </UL>
 * <P>
 * These methods may be invoked on <code>struct</code>,
 * <code>union</code>, <code>enum</code>,
 * and <code>exception</code>:
 * <UL>
 * <LI><code>member_count</code>
 * <LI><code>member_name</code>
 * </UL>
 * <P>
 * These methods may be invoked on <code>struct</code>,
 * <code>union</code>, and <code>exception</code>:
 * <UL>
 * <LI><code>member_type(int index)</code>
 * </UL>
 * <P>
 * These methods may be invoked on <code>union</code>:
 * <UL>
 * <LI><code>member_label</code>
 * <LI><code>discriminator_type</code>
 * <LI><code>default_index</code>
 * </UL>
 * <P>
 * These methods may be invoked on <code>string</code>,
 * <code>sequence</code>, and <code>array</code>:
 * <UL>
 * <LI><code>length</code>
 * </UL>
 * <P>
 * These methods may be invoked on <code>alias</code>,
 * <code>sequence</code>, <code>array</code>, and <code>value_box</code>:
 * <UL>
 * <LI><code>content_type</code>
 * </UL>
 * <P>
 * Unlike other CORBA pseudo-objects, <code>TypeCode</code>
 * objects can be passed as general IDL parameters. <p>
 * The methods <code>parameter</code> and <code>param_count</code>,
 * which are deprecated, are not mapped.  <p>
 *
 * Java IDL extends the CORBA specification to allow all operations permitted
 * on a <code>struct</code> <code>TypeCode</code> to be permitted
 * on an <code>exception</code> <code>TypeCode</code> as well. <p>
 *
 * @version 1.25 09/09/97
 */
public abstract class TypeCode implements IDLEntity {

    /**
     * Compares this <code>TypeCode</code> object with the given one,
     * testing for equality. <code>TypeCode</code> objects are equal if
     * they are interchangeable and give identical results when
     * <code>TypeCode</code> operations are applied to them.
     *
     * @param tc 		the <code>TypeCode</code> object to compare against
     * @return 		<code>true</code> if the type codes are equal;
     *                <code>false</code> otherwise
     */

    public abstract boolean equal(TypeCode tc);

    /**
	 * Tests to see if the given <code>TypeCode</code> object is 
	 * equivalent to this <code>TypeCode</code> object.
	 * <P>
	 * 
	 *
	 * @param tc the typecode to compare with this typecode
	 *
	 * @return <code>true</code> if the given typecode is equivalent to
	 *         this typecode; <code>false</code> otherwise
     * 
     */
    public abstract boolean equivalent(TypeCode tc);

    /**
     * Strips out all optional name and member name fields,
     * but leaves all alias typecodes intact.
	 * @return a <code>TypeCode</code> object with optional name and 
	 *         member name fields stripped out, except for alias typecodes,
	 *         which are left intact
     * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
     *      comments for unimplemented features</a>
     */
    public abstract TypeCode get_compact_typecode();


    /**
     * Retrieves the kind of this <code>TypeCode</code> object.
     * The kind of a type code determines which <code>TypeCode</code>
     * methods may legally be invoked on it.
     * <P>
     * The method <code>kind</code> may be invoked on any
     * <code>TypeCode</code> object.
     *
     * @return	the <code>TCKind</code> instance indicating the
     *            value of the <code>kind</code> field of this
     * 			<code>TypeCode</code> object
     */

    public abstract TCKind kind();

    /**
     * Retrieves the RepositoryId globally identifying the type
     * of this <code>TypeCode</code> object.
     * <P>
     * The method <code>id</code> can be invoked on object reference,
     * structure, union, enumeration, alias, exception, valuetype,
     * boxed valuetype, native, and abstract interface type codes.
     * Object reference, exception, valuetype, boxed valuetype,
     * native, and abstract interface <code>TypeCode</code> objects
     * always have a RepositoryId.
     * Structure, union, enumeration, and alias <code>TypeCode</code> objects
     * obtained from the Interface Repository or the method
     * <code>ORB.create_operation_list</code>
     * also always have a RepositoryId. If there is no RepositoryId, the
     * method can return an empty string.
     *
     * @return		the RepositoryId for this <code>TypeCode</code> object
     *                or an empty string if there is no RepositoryID
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method
     *           is invoked on an inappropriate kind of<code>TypeCode</code>
     *           object
     */

    public abstract String id() throws BadKind;

    /**
     * Retrieves the simple name identifying this <code>TypeCode</code>
     * object within its
     * enclosing scope. Since names are local to a Repository, the
     * name returned from a <code>TypeCode</code> object
     * may not match the name of the
     * type in any particular Repository, and may even be an empty
     * string.
     * <P>
     * The method <code>name</code> can be invoked on object reference,
     * structure, union, enumeration, alias, exception, valuetype,
     * boxed valuetype, native, and abstract interface
     * <code>TypeCode</code> objects.
     *
     * @return		the name identifying this <code>TypeCode</code> object
     *                or an empty string
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method
     *           is invoked on an inappropriate kind of<code>TypeCode</code>
     *           object
     */

    public abstract String name() throws BadKind;

    /**
     * Retrieves the number of members in the type described by
     * this <code>TypeCode</code> object.
     * <P>
     * The method <code>member_count</code> can be invoked on
     * structure, union, and enumeration <code>TypeCode</code> objects.
     * Java IDL extends the CORBA specification to allow this method to
     * operate on exceptions as well.
     *
     * @return		the number of members constituting the type described
     *                by this <code>TypeCode</code> object
     *
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method
     *           is invoked on an inappropriate kind of <code>TypeCode</code>
     *           object
     */

    public abstract int member_count() throws BadKind;

    /**
     * Retrieves the simple name of the member identified by
     * the given index. Since names are local to a
     * Repository, the name returned from a <code>TypeCode</code> object
     * may not match the name of the member in any particular
     * Repository, and may even be an empty string.
     * <P>
     * The  method <code>member_name</code> can be invoked on structure, union,
     * and enumeration <code>TypeCode</code> objects.
     * Java IDL extends the CORBA specification to allow this method to
     * operate on exceptions as well.
     *
     * @param index	index of the member for which a name is being reqested
     * @return		simple name of the member identified by the
     *			index or an empty string
     * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is equal
     *            to or greater than
     *			the number of members constituting the type
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method
     *           is invoked on an inappropriate kind of <code>TypeCode</code>
     *           object
     */

    public abstract String member_name(int index)
	throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds;

    /**
     * Retrieves the <code>TypeCode</code> object describing the type
     * of the member identified by the given index.
     * <P>
     * The method <code>member_type</code> can be invoked on structure
     * and union <code>TypeCode</code> objects.
     * Java IDL extends the CORBA specification to allow this method to
     * operate on exceptions as well.
     *
     * @param index	index of the member for which type information
     *                is begin requested
     * @return		the <code>TypeCode</code> object describing the
     *                member at the given index
     * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is
     *                equal to or greater than
     *			    the number of members constituting the type
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method
     *           is invoked on an inappropriate kind of <code>TypeCode</code>
     *           object
     */

    public abstract TypeCode member_type(int index)
	throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds;

    /**
     * Retrieves the label of the union member
     * identified by the given index. For the default member,
     * the label is the zero octet.
     *<P>
     * The method <code>member_label</code> can only be invoked on union
     * <code>TypeCode</code> objects.
     *
     * @param index	index of the union member for which the
     *                label is being requested
     * @return		an <code>Any</code> object describing the label of
     *                the requested union member or the zero octet for
     *                the default member
     * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is
     *                equal to or greater than
     *			    the number of members constituting the union
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method
     *           is invoked on a non-union <code>TypeCode</code>
     *           object
     */

    public abstract Any member_label(int index)
	throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds;

    /**
     * Returns a <code>TypeCode</code> object describing
     * all non-default member labels.
     * The method <code>discriminator_type</code> can be invoked only
     * on union <code>TypeCode</code> objects.
     *
     * @return		the <code>TypeCode</code> object describing
     *                the non-default member labels
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method
     *           is invoked on a non-union <code>TypeCode</code>
     *           object
     */

    public abstract TypeCode discriminator_type()
	throws BadKind;

    /**
     * Returns the index of the
     * default member, or -1 if there is no default member.
     * <P>
     * The method <code>default_index</code> can be invoked only on union
     * <code>TypeCode</code> objects.
     *
     * @return		the index of the default member, or -1 if
     *			there is no default member
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method
     *           is invoked on a non-union <code>TypeCode</code>
     *           object
     */

    public abstract int default_index() throws BadKind;

    /**
     * Returns the number of elements in the type described by
     * this <code>TypeCode</code> object.
     * For strings and sequences, it returns the
     * bound, with zero indicating an unbounded string or sequence.
     * For arrays, it returns the number of elements in the array.
     * <P>
     * The method <code>length</code> can be invoked on string, sequence, and
     * array <code>TypeCode</code> objects.
     *
     * @return		the bound for strings and sequences, or the
     *			    number of elements for arrays
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method
     *           is invoked on an inappropriate kind of <code>TypeCode</code>
     *           object
     */

    public abstract int length() throws BadKind;

    /**
     * Returns the <code>TypeCode</code> object representing the
     * IDL type for the members of the object described by this
     * <code>TypeCode</code> object.
     * For sequences and arrays, it returns the
     * element type. For aliases, it returns the original type. Note
     * that multidimensional arrays are represented by nesting
     * <code>TypeCode</code> objects, one per dimension.
     * For boxed valuetypes, it returns the boxed type.
     *<P>
     * The method <code>content_type</code> can be invoked on sequence, array,
     * alias, and boxed valuetype <code>TypeCode</code> objects.
     *
     * @return	a <code>TypeCode</code> object representing
     *            the element type for sequences and arrays, the
     *		original type for aliases, or the
     *            boxed type for boxed valuetypes.
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if the method
     *           is invoked on an inappropriate kind of <code>TypeCode</code>
     *           object
     */

    public abstract TypeCode content_type() throws BadKind;


    /**
	 * Returns the number of digits in the fixed type described by this
	 * <code>TypeCode</code> object. For example, the typecode for
	 * the number 3000.275d could be <code>fixed<7,3></code>, where
	 * 7 is the precision and 3 is the scale.
	 *
	 * @return the total number of digits
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if this method
     *           is invoked on an inappropriate kind of <code>TypeCode</code>
     *           object
	 *
     */
    public abstract short fixed_digits() throws BadKind ;

    /**
	 * Returns the scale of the fixed type described by this 
	 * <code>TypeCode</code> object. A positive number indicates the
	 * number of digits to the right of the decimal point. 
	 * For example, the number 3000d could have the
	 * typecode <code>fixed<4,0></code>, where the first number is
	 * the precision and the second number is the scale.
	 * A negative number is also possible and adds zeroes to the
	 * left of the decimal point.  In this case, <code>fixed<1,-3></code>,
	 * could be the typecode for the number 3000d.
	 *
	 * @return the scale of the fixed type that this
	 *         <code>TypeCode</code> object describes
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if this method
     *           is invoked on an inappropriate kind of <code>TypeCode</code>
     *           object
     */
    public abstract short fixed_scale() throws BadKind ;

    /**
     * Returns the constant that indicates the visibility of the member
     * at the given index.
     *
     * This operation can only be invoked on non-boxed value
     * <code>TypeCode</code> objects.
     *
     * @param index an <code>int</code> indicating the index into the
     *               value
     * @return either <code>PRIVATE_MEMBER.value</code> or
     *          <code>PUBLIC_MEMBER.value</code>
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if this method
     *           is invoked on a non-value type <code>TypeCode</code>
     *           object
     * @throws org.omg.CORBA.TypeCodePackage.Bounds
     *           if the given index is out of bounds 
     * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
     *      comments for unimplemented features</a>
     */
    
    abstract public short member_visibility(int index)
        throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds ;

    /**
     * Returns a constant indicating the modifier of the value type
     * that this <code>TypeCode</code> object describes.  The constant
     * returned must be one of the following: <code>VM_NONE.value</code>,
     * <code>VM_ABSTRACT.value</code>, <code>VM_CUSTOM.value</code>,
     * or <code>VM_TRUNCATABLE.value</code>,
     *
     * @return a constant describing the value type
     *         that this <code>TypeCode</code> object describes
     * @throws org.omg.CORBA.TypeCodePackage.BadKind
     *           if this method
     *           is invoked on a non-value type <code>TypeCode</code>
     *           object
     * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
     *      comments for unimplemented features</a>
     */
    
    abstract public short type_modifier() throws BadKind ;

    /**
     * Returns the <code>TypeCode</code> object that describes the concrete base type
     * of the value type that this <code>TypeCode</code> object describes.
     * Returns null if it doesn't have a concrete base type.
     *
     * @return the <code>TypeCode</code> object that describes the
     * concrete base type of the value type
     * that this <code>TypeCode</code> object describes
     * @throws org.omg.CORBA.TypeCodePackage.BadKind if this method
     *           is invoked on a non-boxed value type <code>TypeCode</code> object
     * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
     *      comments for unimplemented features</a>
     */
    
    abstract public TypeCode concrete_base_type() throws BadKind ;
}

Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar