src/share/classes/org/omg/CORBA/DefinitionKind.java

Tue, 25 Mar 2008 14:42:28 -0700

author
ohair
date
Tue, 25 Mar 2008 14:42:28 -0700
changeset 5
5e61d5df6258
parent 1
55540e827aef
child 158
91006f157c46
permissions
-rw-r--r--

6627817: Remove ^M characters in all files (Makefiles too)
Summary: Some files included the use of the ^M character, which has been deleted
Reviewed-by: xdono

duke@1 1 /*
duke@1 2 * Copyright 1997-2001 Sun Microsystems, Inc. All Rights Reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation. Sun designates this
duke@1 8 * particular file as subject to the "Classpath" exception as provided
duke@1 9 * by Sun in the LICENSE file that accompanied this code.
duke@1 10 *
duke@1 11 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 * accompanied this code).
duke@1 16 *
duke@1 17 * You should have received a copy of the GNU General Public License version
duke@1 18 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 *
duke@1 21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@1 22 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@1 23 * have any questions.
duke@1 24 */
duke@1 25
duke@1 26 /*
duke@1 27 * File: ./org/omg/CORBA/DefinitionKind.java
duke@1 28 * From: ./ir.idl
duke@1 29 * Date: Fri Aug 28 16:03:31 1998
duke@1 30 * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
duke@1 31 */
duke@1 32
duke@1 33 package org.omg.CORBA;
duke@1 34
duke@1 35 /**
duke@1 36 * The class that provides the constants used to identify the type of an
duke@1 37 * Interface Repository object. This class contains two kinds of constants,
duke@1 38 * those that are an <code>int</code> and those that are an instance of the class
duke@1 39 * <code>DefinitionKind</code>. This class provides the method
duke@1 40 * <code>from_int</code>, which given one
duke@1 41 * of the <code>int</code> constants, creates the corresponding
duke@1 42 * <code>DefinitionKind</code> instance. It also provides the method
duke@1 43 * <code>value</code>, which returns the <code>int</code> constant that
duke@1 44 * is the value for a <code>DefinitionKind</code> instance.
duke@1 45 *
duke@1 46 * @see IRObject
duke@1 47 */
duke@1 48
duke@1 49 public class DefinitionKind implements org.omg.CORBA.portable.IDLEntity {
duke@1 50
duke@1 51 /**
duke@1 52 * The constant that indicates that an Interface Repository object
duke@1 53 * does not have a definition kind.
duke@1 54 */
duke@1 55 public static final int _dk_none = 0,
duke@1 56
duke@1 57 /**
duke@1 58 * The constant that indicates that the type of an Interface Repository object
duke@1 59 * may be any type.
duke@1 60 */
duke@1 61 _dk_all = 1,
duke@1 62
duke@1 63 /**
duke@1 64 * The constant that indicates that an Interface Repository object is an
duke@1 65 * attribute.
duke@1 66 */
duke@1 67 _dk_Attribute = 2,
duke@1 68
duke@1 69 /**
duke@1 70 * The constant that indicates that an Interface Repository object is a
duke@1 71 * constant.
duke@1 72 */
duke@1 73 _dk_Constant = 3,
duke@1 74
duke@1 75 /**
duke@1 76 * The constant that indicates that an Interface Repository object is an
duke@1 77 * exception.
duke@1 78 */
duke@1 79
duke@1 80 _dk_Exception = 4,
duke@1 81
duke@1 82 /**
duke@1 83 * The constant that indicates that an Interface Repository object is an
duke@1 84 * interface.
duke@1 85 */
duke@1 86
duke@1 87 _dk_Interface = 5,
duke@1 88
duke@1 89 /**
duke@1 90 * The constant that indicates that an Interface Repository object is a
duke@1 91 * module.
duke@1 92 */
duke@1 93
duke@1 94 _dk_Module = 6,
duke@1 95
duke@1 96 /**
duke@1 97 * The constant that indicates that an Interface Repository object is an
duke@1 98 * operation.
duke@1 99 */
duke@1 100
duke@1 101 _dk_Operation = 7,
duke@1 102
duke@1 103 /**
duke@1 104 * The constant that indicates that an Interface Repository object is a
duke@1 105 * Typedef.
duke@1 106 */
duke@1 107
duke@1 108 _dk_Typedef = 8,
duke@1 109
duke@1 110 /**
duke@1 111 * The constant that indicates that an Interface Repository object is an
duke@1 112 * Alias.
duke@1 113 */
duke@1 114
duke@1 115 _dk_Alias = 9,
duke@1 116
duke@1 117 /**
duke@1 118 * The constant that indicates that an Interface Repository object is a
duke@1 119 * Struct.
duke@1 120 */
duke@1 121
duke@1 122 _dk_Struct = 10,
duke@1 123
duke@1 124 /**
duke@1 125 * The constant that indicates that an Interface Repository object is a
duke@1 126 * Union.
duke@1 127 */
duke@1 128
duke@1 129 _dk_Union = 11,
duke@1 130
duke@1 131 /**
duke@1 132 * The constant that indicates that an Interface Repository object is an
duke@1 133 * Enum.
duke@1 134 */
duke@1 135
duke@1 136 _dk_Enum = 12,
duke@1 137
duke@1 138 /**
duke@1 139 * The constant that indicates that an Interface Repository object is a
duke@1 140 * Primitive.
duke@1 141 */
duke@1 142
duke@1 143 _dk_Primitive = 13,
duke@1 144
duke@1 145 /**
duke@1 146 * The constant that indicates that an Interface Repository object is a
duke@1 147 * String.
duke@1 148 */
duke@1 149
duke@1 150 _dk_String = 14,
duke@1 151
duke@1 152 /**
duke@1 153 * The constant that indicates that an Interface Repository object is a
duke@1 154 * Sequence.
duke@1 155 */
duke@1 156
duke@1 157 _dk_Sequence = 15,
duke@1 158
duke@1 159 /**
duke@1 160 * The constant that indicates that an Interface Repository object is an
duke@1 161 * Array.
duke@1 162 */
duke@1 163
duke@1 164 _dk_Array = 16,
duke@1 165
duke@1 166 /**
duke@1 167 * The constant that indicates that an Interface Repository object is a
duke@1 168 * Repository.
duke@1 169 */
duke@1 170
duke@1 171 _dk_Repository = 17,
duke@1 172
duke@1 173 /**
duke@1 174 * The constant that indicates that an Interface Repository object is a
duke@1 175 * Wstring.
duke@1 176 */
duke@1 177
duke@1 178 _dk_Wstring = 18,
duke@1 179
duke@1 180 /**
duke@1 181 * The constant that indicates that an Interface Repository object is of type
duke@1 182 * Fixed.
duke@1 183 */
duke@1 184
duke@1 185 _dk_Fixed = 19,
duke@1 186
duke@1 187 /**
duke@1 188 * The constant that indicates that an Interface Repository object is a
duke@1 189 * Value.
duke@1 190 */
duke@1 191
duke@1 192 _dk_Value = 20,
duke@1 193
duke@1 194 /**
duke@1 195 * The constant that indicates that an Interface Repository object is a
duke@1 196 * ValueBox.
duke@1 197 */
duke@1 198
duke@1 199 _dk_ValueBox = 21,
duke@1 200
duke@1 201 /**
duke@1 202 * The constant that indicates that an Interface Repository object is a
duke@1 203 * ValueMember.
duke@1 204 */
duke@1 205
duke@1 206 _dk_ValueMember = 22,
duke@1 207
duke@1 208 /**
duke@1 209 * The constant that indicates that an Interface Repository object is of type
duke@1 210 * Native.
duke@1 211 */
duke@1 212
duke@1 213 _dk_Native = 23,
duke@1 214
duke@1 215 /**
duke@1 216 * The constant that indicates that an Interface Repository object
duke@1 217 * is representing an abstract interface.
duke@1 218 */
duke@1 219 _dk_AbstractInterface = 24;
duke@1 220
duke@1 221 /**
duke@1 222 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 223 * Interface Repository object has no definition kind.
duke@1 224 */
duke@1 225
duke@1 226 public static final DefinitionKind dk_none = new DefinitionKind(_dk_none);
duke@1 227
duke@1 228 /**
duke@1 229 * The wildcard <code>DefinitionKind</code> constant, useful
duke@1 230 * in all occasions where any
duke@1 231 * <code>DefinitionKind</code> is appropriate. The Container's
duke@1 232 * <code>contents</code> method
duke@1 233 * makes use of this constant to return all contained definitions of any kind.
duke@1 234 */
duke@1 235
duke@1 236 public static final DefinitionKind dk_all = new DefinitionKind(_dk_all);
duke@1 237
duke@1 238 /**
duke@1 239 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 240 * Interface Repository object is an Attribute.
duke@1 241 */
duke@1 242
duke@1 243 public static final DefinitionKind dk_Attribute = new DefinitionKind(_dk_Attribute);
duke@1 244
duke@1 245 /**
duke@1 246 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 247 * Interface Repository object is a constant.
duke@1 248 */
duke@1 249
duke@1 250 public static final DefinitionKind dk_Constant = new DefinitionKind(_dk_Constant);
duke@1 251
duke@1 252
duke@1 253 /**
duke@1 254 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 255 * Interface Repository object is an Exception.
duke@1 256 */
duke@1 257
duke@1 258 public static final DefinitionKind dk_Exception = new DefinitionKind(_dk_Exception);
duke@1 259
duke@1 260 /**
duke@1 261 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 262 * Interface Repository object is an Interface.
duke@1 263 */
duke@1 264
duke@1 265 public static final DefinitionKind dk_Interface = new DefinitionKind(_dk_Interface);
duke@1 266
duke@1 267 /**
duke@1 268 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 269 * Interface Repository object is a Module.
duke@1 270 */
duke@1 271
duke@1 272 public static final DefinitionKind dk_Module = new DefinitionKind(_dk_Module);
duke@1 273
duke@1 274 /**
duke@1 275 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 276 * Interface Repository object is an Operation.
duke@1 277 */
duke@1 278
duke@1 279 public static final DefinitionKind dk_Operation = new DefinitionKind(_dk_Operation);
duke@1 280
duke@1 281 /**
duke@1 282 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 283 * Interface Repository object is a Typedef.
duke@1 284 */
duke@1 285
duke@1 286 public static final DefinitionKind dk_Typedef = new DefinitionKind(_dk_Typedef);
duke@1 287
duke@1 288 /**
duke@1 289 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 290 * Interface Repository object is an Alias.
duke@1 291 */
duke@1 292
duke@1 293 public static final DefinitionKind dk_Alias = new DefinitionKind(_dk_Alias);
duke@1 294
duke@1 295 /**
duke@1 296 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 297 * Interface Repository object is a Struct.
duke@1 298 */
duke@1 299
duke@1 300 public static final DefinitionKind dk_Struct = new DefinitionKind(_dk_Struct);
duke@1 301
duke@1 302 /**
duke@1 303 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 304 * Interface Repository object is a Union.
duke@1 305 */
duke@1 306
duke@1 307 public static final DefinitionKind dk_Union = new DefinitionKind(_dk_Union);
duke@1 308
duke@1 309 /**
duke@1 310 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 311 * Interface Repository object is an Enum.
duke@1 312 */
duke@1 313
duke@1 314 public static final DefinitionKind dk_Enum = new DefinitionKind(_dk_Enum);
duke@1 315
duke@1 316 /**
duke@1 317 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 318 * Interface Repository object is a Primitive.
duke@1 319 */
duke@1 320
duke@1 321 public static final DefinitionKind dk_Primitive = new DefinitionKind(_dk_Primitive);
duke@1 322
duke@1 323 /**
duke@1 324 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 325 * Interface Repository object is a String.
duke@1 326 */
duke@1 327
duke@1 328 public static final DefinitionKind dk_String = new DefinitionKind(_dk_String);
duke@1 329
duke@1 330 /**
duke@1 331 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 332 * Interface Repository object is a Sequence.
duke@1 333 */
duke@1 334
duke@1 335 public static final DefinitionKind dk_Sequence = new DefinitionKind(_dk_Sequence);
duke@1 336
duke@1 337 /**
duke@1 338 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 339 * Interface Repository object is an Array.
duke@1 340 */
duke@1 341
duke@1 342 public static final DefinitionKind dk_Array = new DefinitionKind(_dk_Array);
duke@1 343
duke@1 344
duke@1 345 /**
duke@1 346 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 347 * Interface Repository object is a Repository.
duke@1 348 */
duke@1 349
duke@1 350 public static final DefinitionKind dk_Repository = new DefinitionKind(_dk_Repository);
duke@1 351
duke@1 352
duke@1 353 /**
duke@1 354 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 355 * Interface Repository object is a Wstring.
duke@1 356 */
duke@1 357
duke@1 358 public static final DefinitionKind dk_Wstring = new DefinitionKind(_dk_Wstring);
duke@1 359
duke@1 360 /**
duke@1 361 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 362 * Interface Repository object is a Fixed value.
duke@1 363 */
duke@1 364
duke@1 365 public static final DefinitionKind dk_Fixed = new DefinitionKind(_dk_Fixed);
duke@1 366
duke@1 367 /**
duke@1 368 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 369 * Interface Repository object is a Value.
duke@1 370 */
duke@1 371
duke@1 372 public static final DefinitionKind dk_Value = new DefinitionKind(_dk_Value);
duke@1 373
duke@1 374 /**
duke@1 375 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 376 * Interface Repository object is a ValueBox.
duke@1 377 */
duke@1 378
duke@1 379 public static final DefinitionKind dk_ValueBox = new DefinitionKind(_dk_ValueBox);
duke@1 380
duke@1 381 /**
duke@1 382 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 383 * Interface Repository object is a ValueMember.
duke@1 384 */
duke@1 385
duke@1 386 public static final DefinitionKind dk_ValueMember = new DefinitionKind(_dk_ValueMember);
duke@1 387
duke@1 388
duke@1 389 /**
duke@1 390 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 391 * Interface Repository object is a Native value.
duke@1 392 */
duke@1 393
duke@1 394 public static final DefinitionKind dk_Native = new DefinitionKind(_dk_Native);
duke@1 395
duke@1 396
duke@1 397 /**
duke@1 398 * The static instance of <code>DefinitionKind</code> indicating that an
duke@1 399 * Interface Repository object represents an abstract interface.
duke@1 400 */
duke@1 401 public static final DefinitionKind dk_AbstractInterface = new DefinitionKind(_dk_AbstractInterface);
duke@1 402
duke@1 403
duke@1 404 /**
duke@1 405 * Returns the <code>int</code> constant identifying the type of an IR object.
duke@1 406 * @return the <code>int</code> constant from the class
duke@1 407 * <code>DefinitionKind</code> that is the value of this
duke@1 408 * <code>DefinitionKind</code> instance
duke@1 409 */
duke@1 410
duke@1 411 public int value() {
duke@1 412 return _value;
duke@1 413 }
duke@1 414
duke@1 415
duke@1 416 /**
duke@1 417 * Creates a <code>DefinitionKind</code> instance corresponding to the given code
duke@1 418 .
duke@1 419 * @param i one of the <code>int</code> constants from the class
duke@1 420 * <code>DefinitionKind</code>
duke@1 421 * @return the <code>DefinitionKind</code> instance corresponding
duke@1 422 * to the given code
duke@1 423 * @throws org.omg.CORBA.BAD_PARAM if the given parameter is not
duke@1 424 one
duke@1 425 * of the <code>int</code> constants from the class
duke@1 426 * <code>DefinitionKind</code>
duke@1 427 */
duke@1 428
duke@1 429 public static DefinitionKind from_int(int i) {
duke@1 430 switch (i) {
duke@1 431 case _dk_none:
duke@1 432 return dk_none;
duke@1 433 case _dk_all:
duke@1 434 return dk_all;
duke@1 435 case _dk_Attribute:
duke@1 436 return dk_Attribute;
duke@1 437 case _dk_Constant:
duke@1 438 return dk_Constant;
duke@1 439 case _dk_Exception:
duke@1 440 return dk_Exception;
duke@1 441 case _dk_Interface:
duke@1 442 return dk_Interface;
duke@1 443 case _dk_Module:
duke@1 444 return dk_Module;
duke@1 445 case _dk_Operation:
duke@1 446 return dk_Operation;
duke@1 447 case _dk_Typedef:
duke@1 448 return dk_Typedef;
duke@1 449 case _dk_Alias:
duke@1 450 return dk_Alias;
duke@1 451 case _dk_Struct:
duke@1 452 return dk_Struct;
duke@1 453 case _dk_Union:
duke@1 454 return dk_Union;
duke@1 455 case _dk_Enum:
duke@1 456 return dk_Enum;
duke@1 457 case _dk_Primitive:
duke@1 458 return dk_Primitive;
duke@1 459 case _dk_String:
duke@1 460 return dk_String;
duke@1 461 case _dk_Sequence:
duke@1 462 return dk_Sequence;
duke@1 463 case _dk_Array:
duke@1 464 return dk_Array;
duke@1 465 case _dk_Repository:
duke@1 466 return dk_Repository;
duke@1 467 case _dk_Wstring:
duke@1 468 return dk_Wstring;
duke@1 469 case _dk_Fixed:
duke@1 470 return dk_Fixed;
duke@1 471 case _dk_Value:
duke@1 472 return dk_Value;
duke@1 473 case _dk_ValueBox:
duke@1 474 return dk_ValueBox;
duke@1 475 case _dk_ValueMember:
duke@1 476 return dk_ValueMember;
duke@1 477 case _dk_Native:
duke@1 478 return dk_Native;
duke@1 479 default:
duke@1 480 throw new org.omg.CORBA.BAD_PARAM();
duke@1 481 }
duke@1 482 }
duke@1 483
duke@1 484 /**
duke@1 485 * Constructs a <code>DefinitionKind</code> object with its <code>_value</code>
duke@1 486 * field initialized with the given value.
duke@1 487 * @param _value one of the <code>int</code> constants defined in the
duke@1 488 * class <code>DefinitionKind</code>
duke@1 489 */
duke@1 490
duke@1 491 protected DefinitionKind(int _value){
duke@1 492 this._value = _value;
duke@1 493 }
duke@1 494
duke@1 495 /**
duke@1 496 * The field that holds a value for a <code>DefinitionKind</code> object.
duke@1 497 * @serial
duke@1 498 */
duke@1 499
duke@1 500 private int _value;
duke@1 501 }

mercurial