KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > CORBA > DefinitionKind


1 /*
2  * @(#)DefinitionKind.java 1.31 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 /*
9  * File: ./org/omg/CORBA/DefinitionKind.java
10  * From: ./ir.idl
11  * Date: Fri Aug 28 16:03:31 1998
12  * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
13  */

14
15 package org.omg.CORBA;
16
17 /**
18 * The class that provides the constants used to identify the type of an
19 * Interface Repository object. This class contains two kinds of constants,
20 * those that are an <code>int</code> and those that are an instance of the class
21 * <code>DefinitionKind</code>. This class provides the method
22 * <code>from_int</code>, which given one
23 * of the <code>int</code> constants, creates the corresponding
24 * <code>DefinitionKind</code> instance. It also provides the method
25 * <code>value</code>, which returns the <code>int</code> constant that
26 * is the value for a <code>DefinitionKind</code> instance.
27 *
28 * @see IRObject
29 */

30
31 public class DefinitionKind implements org.omg.CORBA.portable.IDLEntity JavaDoc {
32
33 /**
34  * The constant that indicates that an Interface Repository object
35  * does not have a definition kind.
36  */

37         public static final int _dk_none = 0,
38
39 /**
40  * The constant that indicates that the type of an Interface Repository object
41  * may be any type.
42  */

43     _dk_all = 1,
44
45 /**
46  * The constant that indicates that an Interface Repository object is an
47  * attribute.
48  */

49     _dk_Attribute = 2,
50
51 /**
52  * The constant that indicates that an Interface Repository object is a
53  * constant.
54  */

55     _dk_Constant = 3,
56
57 /**
58  * The constant that indicates that an Interface Repository object is an
59  * exception.
60  */

61
62     _dk_Exception = 4,
63
64 /**
65  * The constant that indicates that an Interface Repository object is an
66  * interface.
67  */

68
69     _dk_Interface = 5,
70
71 /**
72  * The constant that indicates that an Interface Repository object is a
73  * module.
74  */

75
76     _dk_Module = 6,
77
78 /**
79  * The constant that indicates that an Interface Repository object is an
80  * operation.
81  */

82
83     _dk_Operation = 7,
84
85 /**
86  * The constant that indicates that an Interface Repository object is a
87  * Typedef.
88  */

89
90     _dk_Typedef = 8,
91
92 /**
93  * The constant that indicates that an Interface Repository object is an
94  * Alias.
95  */

96
97     _dk_Alias = 9,
98
99 /**
100  * The constant that indicates that an Interface Repository object is a
101  * Struct.
102  */

103
104     _dk_Struct = 10,
105
106 /**
107  * The constant that indicates that an Interface Repository object is a
108  * Union.
109  */

110
111     _dk_Union = 11,
112
113 /**
114  * The constant that indicates that an Interface Repository object is an
115  * Enum.
116  */

117
118     _dk_Enum = 12,
119
120 /**
121  * The constant that indicates that an Interface Repository object is a
122  * Primitive.
123  */

124
125     _dk_Primitive = 13,
126
127 /**
128  * The constant that indicates that an Interface Repository object is a
129  * String.
130  */

131
132     _dk_String = 14,
133
134 /**
135  * The constant that indicates that an Interface Repository object is a
136  * Sequence.
137  */

138
139     _dk_Sequence = 15,
140
141 /**
142  * The constant that indicates that an Interface Repository object is an
143  * Array.
144  */

145
146     _dk_Array = 16,
147
148 /**
149  * The constant that indicates that an Interface Repository object is a
150  * Repository.
151  */

152
153     _dk_Repository = 17,
154
155 /**
156  * The constant that indicates that an Interface Repository object is a
157  * Wstring.
158  */

159
160     _dk_Wstring = 18,
161
162 /**
163  * The constant that indicates that an Interface Repository object is of type
164  * Fixed.
165  */

166
167     _dk_Fixed = 19,
168
169 /**
170  * The constant that indicates that an Interface Repository object is a
171  * Value.
172  */

173
174     _dk_Value = 20,
175
176 /**
177  * The constant that indicates that an Interface Repository object is a
178  * ValueBox.
179  */

180
181     _dk_ValueBox = 21,
182
183 /**
184  * The constant that indicates that an Interface Repository object is a
185  * ValueMember.
186  */

187
188     _dk_ValueMember = 22,
189
190 /**
191  * The constant that indicates that an Interface Repository object is of type
192  * Native.
193  */

194
195     _dk_Native = 23,
196
197 /**
198  * The constant that indicates that an Interface Repository object
199  * is representing an abstract interface.
200  */

201     _dk_AbstractInterface = 24;
202
203 /**
204  * The static instance of <code>DefinitionKind</code> indicating that an
205  * Interface Repository object has no definition kind.
206  */

207
208     public static final DefinitionKind JavaDoc dk_none = new DefinitionKind JavaDoc(_dk_none);
209
210      /**
211          * The wildcard <code>DefinitionKind</code> constant, useful
212          * in all occasions where any
213      * <code>DefinitionKind</code> is appropriate. The Container's
214          * <code>contents</code> method
215      * makes use of this constant to return all contained definitions of any kind.
216          */

217
218     public static final DefinitionKind JavaDoc dk_all = new DefinitionKind JavaDoc(_dk_all);
219
220 /**
221  * The static instance of <code>DefinitionKind</code> indicating that an
222  * Interface Repository object is an Attribute.
223  */

224
225     public static final DefinitionKind JavaDoc dk_Attribute = new DefinitionKind JavaDoc(_dk_Attribute);
226
227 /**
228  * The static instance of <code>DefinitionKind</code> indicating that an
229  * Interface Repository object is a constant.
230  */

231
232     public static final DefinitionKind JavaDoc dk_Constant = new DefinitionKind JavaDoc(_dk_Constant);
233
234
235 /**
236  * The static instance of <code>DefinitionKind</code> indicating that an
237  * Interface Repository object is an Exception.
238  */

239
240     public static final DefinitionKind JavaDoc dk_Exception = new DefinitionKind JavaDoc(_dk_Exception);
241
242 /**
243  * The static instance of <code>DefinitionKind</code> indicating that an
244  * Interface Repository object is an Interface.
245  */

246
247     public static final DefinitionKind JavaDoc dk_Interface = new DefinitionKind JavaDoc(_dk_Interface);
248
249 /**
250  * The static instance of <code>DefinitionKind</code> indicating that an
251  * Interface Repository object is a Module.
252  */

253
254     public static final DefinitionKind JavaDoc dk_Module = new DefinitionKind JavaDoc(_dk_Module);
255
256 /**
257  * The static instance of <code>DefinitionKind</code> indicating that an
258  * Interface Repository object is an Operation.
259  */

260
261     public static final DefinitionKind JavaDoc dk_Operation = new DefinitionKind JavaDoc(_dk_Operation);
262
263 /**
264  * The static instance of <code>DefinitionKind</code> indicating that an
265  * Interface Repository object is a Typedef.
266  */

267
268     public static final DefinitionKind JavaDoc dk_Typedef = new DefinitionKind JavaDoc(_dk_Typedef);
269
270 /**
271  * The static instance of <code>DefinitionKind</code> indicating that an
272  * Interface Repository object is an Alias.
273  */

274
275     public static final DefinitionKind JavaDoc dk_Alias = new DefinitionKind JavaDoc(_dk_Alias);
276
277 /**
278  * The static instance of <code>DefinitionKind</code> indicating that an
279  * Interface Repository object is a Struct.
280  */

281
282     public static final DefinitionKind JavaDoc dk_Struct = new DefinitionKind JavaDoc(_dk_Struct);
283
284 /**
285  * The static instance of <code>DefinitionKind</code> indicating that an
286  * Interface Repository object is a Union.
287  */

288
289     public static final DefinitionKind JavaDoc dk_Union = new DefinitionKind JavaDoc(_dk_Union);
290
291 /**
292  * The static instance of <code>DefinitionKind</code> indicating that an
293  * Interface Repository object is an Enum.
294  */

295
296     public static final DefinitionKind JavaDoc dk_Enum = new DefinitionKind JavaDoc(_dk_Enum);
297
298 /**
299  * The static instance of <code>DefinitionKind</code> indicating that an
300  * Interface Repository object is a Primitive.
301  */

302
303     public static final DefinitionKind JavaDoc dk_Primitive = new DefinitionKind JavaDoc(_dk_Primitive);
304
305 /**
306  * The static instance of <code>DefinitionKind</code> indicating that an
307  * Interface Repository object is a String.
308  */

309
310     public static final DefinitionKind JavaDoc dk_String = new DefinitionKind JavaDoc(_dk_String);
311
312 /**
313  * The static instance of <code>DefinitionKind</code> indicating that an
314  * Interface Repository object is a Sequence.
315  */

316
317     public static final DefinitionKind JavaDoc dk_Sequence = new DefinitionKind JavaDoc(_dk_Sequence);
318
319 /**
320  * The static instance of <code>DefinitionKind</code> indicating that an
321  * Interface Repository object is an Array.
322  */

323
324     public static final DefinitionKind JavaDoc dk_Array = new DefinitionKind JavaDoc(_dk_Array);
325
326
327 /**
328  * The static instance of <code>DefinitionKind</code> indicating that an
329  * Interface Repository object is a Repository.
330  */

331
332     public static final DefinitionKind JavaDoc dk_Repository = new DefinitionKind JavaDoc(_dk_Repository);
333
334
335 /**
336  * The static instance of <code>DefinitionKind</code> indicating that an
337  * Interface Repository object is a Wstring.
338  */

339
340     public static final DefinitionKind JavaDoc dk_Wstring = new DefinitionKind JavaDoc(_dk_Wstring);
341
342 /**
343  * The static instance of <code>DefinitionKind</code> indicating that an
344  * Interface Repository object is a Fixed value.
345  */

346
347     public static final DefinitionKind JavaDoc dk_Fixed = new DefinitionKind JavaDoc(_dk_Fixed);
348
349 /**
350  * The static instance of <code>DefinitionKind</code> indicating that an
351  * Interface Repository object is a Value.
352  */

353
354     public static final DefinitionKind JavaDoc dk_Value = new DefinitionKind JavaDoc(_dk_Value);
355
356 /**
357  * The static instance of <code>DefinitionKind</code> indicating that an
358  * Interface Repository object is a ValueBox.
359  */

360
361     public static final DefinitionKind JavaDoc dk_ValueBox = new DefinitionKind JavaDoc(_dk_ValueBox);
362
363 /**
364  * The static instance of <code>DefinitionKind</code> indicating that an
365  * Interface Repository object is a ValueMember.
366  */

367
368     public static final DefinitionKind JavaDoc dk_ValueMember = new DefinitionKind JavaDoc(_dk_ValueMember);
369
370
371 /**
372  * The static instance of <code>DefinitionKind</code> indicating that an
373  * Interface Repository object is a Native value.
374  */

375
376     public static final DefinitionKind JavaDoc dk_Native = new DefinitionKind JavaDoc(_dk_Native);
377
378
379 /**
380 * The static instance of <code>DefinitionKind</code> indicating that an
381 * Interface Repository object represents an abstract interface.
382 */

383     public static final DefinitionKind JavaDoc dk_AbstractInterface = new DefinitionKind JavaDoc(_dk_AbstractInterface);
384
385
386      /**
387      * Returns the <code>int</code> constant identifying the type of an IR object.
388      * @return the <code>int</code> constant from the class
389          * <code>DefinitionKind</code> that is the value of this
390          * <code>DefinitionKind</code> instance
391      */

392
393     public int value() {
394     return _value;
395     }
396
397
398      /**
399      * Creates a <code>DefinitionKind</code> instance corresponding to the given code
400 .
401      * @param i one of the <code>int</code> constants from the class
402          * <code>DefinitionKind</code>
403          * @return the <code>DefinitionKind</code> instance corresponding
404          * to the given code
405          * @throws org.omg.CORBA.BAD_PARAM if the given parameter is not
406  one
407          * of the <code>int</code> constants from the class
408          * <code>DefinitionKind</code>
409      */

410
411     public static DefinitionKind JavaDoc from_int(int i) {
412     switch (i) {
413     case _dk_none:
414         return dk_none;
415     case _dk_all:
416         return dk_all;
417     case _dk_Attribute:
418         return dk_Attribute;
419     case _dk_Constant:
420         return dk_Constant;
421     case _dk_Exception:
422         return dk_Exception;
423     case _dk_Interface:
424         return dk_Interface;
425     case _dk_Module:
426         return dk_Module;
427     case _dk_Operation:
428         return dk_Operation;
429     case _dk_Typedef:
430         return dk_Typedef;
431     case _dk_Alias:
432         return dk_Alias;
433     case _dk_Struct:
434         return dk_Struct;
435     case _dk_Union:
436         return dk_Union;
437     case _dk_Enum:
438         return dk_Enum;
439     case _dk_Primitive:
440         return dk_Primitive;
441     case _dk_String:
442         return dk_String;
443     case _dk_Sequence:
444         return dk_Sequence;
445     case _dk_Array:
446         return dk_Array;
447     case _dk_Repository:
448         return dk_Repository;
449     case _dk_Wstring:
450         return dk_Wstring;
451     case _dk_Fixed:
452         return dk_Fixed;
453     case _dk_Value:
454         return dk_Value;
455     case _dk_ValueBox:
456         return dk_ValueBox;
457     case _dk_ValueMember:
458         return dk_ValueMember;
459     case _dk_Native:
460         return dk_Native;
461     default:
462         throw new org.omg.CORBA.BAD_PARAM JavaDoc();
463     }
464     }
465
466    /**
467     * Constructs a <code>DefinitionKind</code> object with its <code>_value</code>
468     * field initialized with the given value.
469     * @param _value one of the <code>int</code> constants defined in the
470     * class <code>DefinitionKind</code>
471     */

472
473     protected DefinitionKind(int _value){
474     this._value = _value;
475     }
476
477      /**
478       * The field that holds a value for a <code>DefinitionKind</code> object.
479       * @serial
480       */

481
482     private int _value;
483 }
484
Popular Tags