1. /*
  2. * @(#)DefinitionKind.java 1.25 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. /*
  11. * File: ./org/omg/CORBA/DefinitionKind.java
  12. * From: ./ir.idl
  13. * Date: Fri Aug 28 16:03:31 1998
  14. * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
  15. */
  16. package org.omg.CORBA;
  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. public class DefinitionKind implements org.omg.CORBA.portable.IDLEntity {
  31. /**
  32. * The constant that indicates that an Interface Repository object
  33. * does not have a definition kind.
  34. */
  35. public static final int _dk_none = 0,
  36. /**
  37. * The constant that indicates that the type of an Interface Repository object
  38. * may be any type.
  39. */
  40. _dk_all = 1,
  41. /**
  42. * The constant that indicates that an Interface Repository object is an
  43. * attribute.
  44. */
  45. _dk_Attribute = 2,
  46. /**
  47. * The constant that indicates that an Interface Repository object is a
  48. * constant.
  49. */
  50. _dk_Constant = 3,
  51. /**
  52. * The constant that indicates that an Interface Repository object is an
  53. * exception.
  54. */
  55. _dk_Exception = 4,
  56. /**
  57. * The constant that indicates that an Interface Repository object is an
  58. * interface.
  59. */
  60. _dk_Interface = 5,
  61. /**
  62. * The constant that indicates that an Interface Repository object is a
  63. * module.
  64. */
  65. _dk_Module = 6,
  66. /**
  67. * The constant that indicates that an Interface Repository object is an
  68. * operation.
  69. */
  70. _dk_Operation = 7,
  71. /**
  72. * The constant that indicates that an Interface Repository object is a
  73. * Typedef.
  74. */
  75. _dk_Typedef = 8,
  76. /**
  77. * The constant that indicates that an Interface Repository object is an
  78. * Alias.
  79. */
  80. _dk_Alias = 9,
  81. /**
  82. * The constant that indicates that an Interface Repository object is a
  83. * Struct.
  84. */
  85. _dk_Struct = 10,
  86. /**
  87. * The constant that indicates that an Interface Repository object is a
  88. * Union.
  89. */
  90. _dk_Union = 11,
  91. /**
  92. * The constant that indicates that an Interface Repository object is an
  93. * Enum.
  94. */
  95. _dk_Enum = 12,
  96. /**
  97. * The constant that indicates that an Interface Repository object is a
  98. * Primitive.
  99. */
  100. _dk_Primitive = 13,
  101. /**
  102. * The constant that indicates that an Interface Repository object is a
  103. * String.
  104. */
  105. _dk_String = 14,
  106. /**
  107. * The constant that indicates that an Interface Repository object is a
  108. * Sequence.
  109. */
  110. _dk_Sequence = 15,
  111. /**
  112. * The constant that indicates that an Interface Repository object is an
  113. * Array.
  114. */
  115. _dk_Array = 16,
  116. /**
  117. * The constant that indicates that an Interface Repository object is a
  118. * Repository.
  119. */
  120. _dk_Repository = 17,
  121. /**
  122. * The constant that indicates that an Interface Repository object is a
  123. * Wstring.
  124. */
  125. _dk_Wstring = 18,
  126. /**
  127. * The constant that indicates that an Interface Repository object is of type
  128. * Fixed.
  129. */
  130. _dk_Fixed = 19,
  131. /**
  132. * The constant that indicates that an Interface Repository object is a
  133. * Value.
  134. */
  135. _dk_Value = 20,
  136. /**
  137. * The constant that indicates that an Interface Repository object is a
  138. * ValueBox.
  139. */
  140. _dk_ValueBox = 21,
  141. /**
  142. * The constant that indicates that an Interface Repository object is a
  143. * ValueMember.
  144. */
  145. _dk_ValueMember = 22,
  146. /**
  147. * The constant that indicates that an Interface Repository object is of type
  148. * Native.
  149. */
  150. _dk_Native = 23;
  151. /**
  152. * The static instance of <code>DefinitionKind</code> indicating that an
  153. * Interface Repository object has no definition kind.
  154. */
  155. public static final DefinitionKind dk_none = new DefinitionKind(_dk_none);
  156. /**
  157. * The wildcard <code>DefinitionKind</code> constant, useful
  158. * in all occasions where any
  159. * <code>DefinitionKind</code> is appropriate. The Container's
  160. * <code>contents</code> method
  161. * makes use of this constant to return all contained definitions of any kind.
  162. */
  163. public static final DefinitionKind dk_all = new DefinitionKind(_dk_all);
  164. /**
  165. * The static instance of <code>DefinitionKind</code> indicating that an
  166. * Interface Repository object is an Attribute.
  167. */
  168. public static final DefinitionKind dk_Attribute = new DefinitionKind(_dk_Attribute);
  169. /**
  170. * The static instance of <code>DefinitionKind</code> indicating that an
  171. * Interface Repository object is a constant.
  172. */
  173. public static final DefinitionKind dk_Constant = new DefinitionKind(_dk_Constant);
  174. /**
  175. * The static instance of <code>DefinitionKind</code> indicating that an
  176. * Interface Repository object is an Exception.
  177. */
  178. public static final DefinitionKind dk_Exception = new DefinitionKind(_dk_Exception);
  179. /**
  180. * The static instance of <code>DefinitionKind</code> indicating that an
  181. * Interface Repository object is an Interface.
  182. */
  183. public static final DefinitionKind dk_Interface = new DefinitionKind(_dk_Interface);
  184. /**
  185. * The static instance of <code>DefinitionKind</code> indicating that an
  186. * Interface Repository object is a Module.
  187. */
  188. public static final DefinitionKind dk_Module = new DefinitionKind(_dk_Module);
  189. /**
  190. * The static instance of <code>DefinitionKind</code> indicating that an
  191. * Interface Repository object is an Operation.
  192. */
  193. public static final DefinitionKind dk_Operation = new DefinitionKind(_dk_Operation);
  194. /**
  195. * The static instance of <code>DefinitionKind</code> indicating that an
  196. * Interface Repository object is a Typedef.
  197. */
  198. public static final DefinitionKind dk_Typedef = new DefinitionKind(_dk_Typedef);
  199. /**
  200. * The static instance of <code>DefinitionKind</code> indicating that an
  201. * Interface Repository object is an Alias.
  202. */
  203. public static final DefinitionKind dk_Alias = new DefinitionKind(_dk_Alias);
  204. /**
  205. * The static instance of <code>DefinitionKind</code> indicating that an
  206. * Interface Repository object is a Struct.
  207. */
  208. public static final DefinitionKind dk_Struct = new DefinitionKind(_dk_Struct);
  209. /**
  210. * The static instance of <code>DefinitionKind</code> indicating that an
  211. * Interface Repository object is a Union.
  212. */
  213. public static final DefinitionKind dk_Union = new DefinitionKind(_dk_Union);
  214. /**
  215. * The static instance of <code>DefinitionKind</code> indicating that an
  216. * Interface Repository object is an Enum.
  217. */
  218. public static final DefinitionKind dk_Enum = new DefinitionKind(_dk_Enum);
  219. /**
  220. * The static instance of <code>DefinitionKind</code> indicating that an
  221. * Interface Repository object is a Primitive.
  222. */
  223. public static final DefinitionKind dk_Primitive = new DefinitionKind(_dk_Primitive);
  224. /**
  225. * The static instance of <code>DefinitionKind</code> indicating that an
  226. * Interface Repository object is a String.
  227. */
  228. public static final DefinitionKind dk_String = new DefinitionKind(_dk_String);
  229. /**
  230. * The static instance of <code>DefinitionKind</code> indicating that an
  231. * Interface Repository object is a Sequence.
  232. */
  233. public static final DefinitionKind dk_Sequence = new DefinitionKind(_dk_Sequence);
  234. /**
  235. * The static instance of <code>DefinitionKind</code> indicating that an
  236. * Interface Repository object is an Array.
  237. */
  238. public static final DefinitionKind dk_Array = new DefinitionKind(_dk_Array);
  239. /**
  240. * The static instance of <code>DefinitionKind</code> indicating that an
  241. * Interface Repository object is a Repository.
  242. */
  243. public static final DefinitionKind dk_Repository = new DefinitionKind(_dk_Repository);
  244. /**
  245. * The static instance of <code>DefinitionKind</code> indicating that an
  246. * Interface Repository object is a Wstring.
  247. */
  248. public static final DefinitionKind dk_Wstring = new DefinitionKind(_dk_Wstring);
  249. /**
  250. * The static instance of <code>DefinitionKind</code> indicating that an
  251. * Interface Repository object is a Fixed value.
  252. */
  253. public static final DefinitionKind dk_Fixed = new DefinitionKind(_dk_Fixed);
  254. /**
  255. * The static instance of <code>DefinitionKind</code> indicating that an
  256. * Interface Repository object is a Value.
  257. */
  258. public static final DefinitionKind dk_Value = new DefinitionKind(_dk_Value);
  259. /**
  260. * The static instance of <code>DefinitionKind</code> indicating that an
  261. * Interface Repository object is a ValueBox.
  262. */
  263. public static final DefinitionKind dk_ValueBox = new DefinitionKind(_dk_ValueBox);
  264. /**
  265. * The static instance of <code>DefinitionKind</code> indicating that an
  266. * Interface Repository object is a ValueMember.
  267. */
  268. public static final DefinitionKind dk_ValueMember = new DefinitionKind(_dk_ValueMember);
  269. /**
  270. * The static instance of <code>DefinitionKind</code> indicating that an
  271. * Interface Repository object is a Native value.
  272. */
  273. public static final DefinitionKind dk_Native = new DefinitionKind(_dk_Native);
  274. /**
  275. * Returns the <code>int</code> constant identifying the type of an IR object.
  276. * @return the <code>int</code> constant from the class
  277. * <code>DefinitionKind</code> that is the value of this
  278. * <code>DefinitionKind</code> instance
  279. */
  280. public int value() {
  281. return _value;
  282. }
  283. /**
  284. * Creates a <code>DefinitionKind</code> instance corresponding to the given code
  285. .
  286. * @param i one of the <code>int</code> constants from the class
  287. * <code>DefinitionKind</code>
  288. * @return the <code>DefinitionKind</code> instance corresponding
  289. * to the given code
  290. * @throws org.omg.CORBA.BAD_PARAM if the given parameter is not
  291. one
  292. * of the <code>int</code> constants from the class
  293. * <code>DefinitionKind</code>
  294. */
  295. public static DefinitionKind from_int(int i) throws org.omg.CORBA.BAD_PARAM {
  296. switch (i) {
  297. case _dk_none:
  298. return dk_none;
  299. case _dk_all:
  300. return dk_all;
  301. case _dk_Attribute:
  302. return dk_Attribute;
  303. case _dk_Constant:
  304. return dk_Constant;
  305. case _dk_Exception:
  306. return dk_Exception;
  307. case _dk_Interface:
  308. return dk_Interface;
  309. case _dk_Module:
  310. return dk_Module;
  311. case _dk_Operation:
  312. return dk_Operation;
  313. case _dk_Typedef:
  314. return dk_Typedef;
  315. case _dk_Alias:
  316. return dk_Alias;
  317. case _dk_Struct:
  318. return dk_Struct;
  319. case _dk_Union:
  320. return dk_Union;
  321. case _dk_Enum:
  322. return dk_Enum;
  323. case _dk_Primitive:
  324. return dk_Primitive;
  325. case _dk_String:
  326. return dk_String;
  327. case _dk_Sequence:
  328. return dk_Sequence;
  329. case _dk_Array:
  330. return dk_Array;
  331. case _dk_Repository:
  332. return dk_Repository;
  333. case _dk_Wstring:
  334. return dk_Wstring;
  335. case _dk_Fixed:
  336. return dk_Fixed;
  337. case _dk_Value:
  338. return dk_Value;
  339. case _dk_ValueBox:
  340. return dk_ValueBox;
  341. case _dk_ValueMember:
  342. return dk_ValueMember;
  343. case _dk_Native:
  344. return dk_Native;
  345. default:
  346. throw new org.omg.CORBA.BAD_PARAM();
  347. }
  348. }
  349. /**
  350. * Constructs a <code>DefinitionKind</code> object with its <code>_value</code>
  351. * field initialized with the given value.
  352. * @param _value one of the <code>int</code> constants defined in the
  353. * class <code>DefinitionKind</code>
  354. */
  355. protected DefinitionKind(int _value){
  356. this._value = _value;
  357. }
  358. /**
  359. * The field that holds a value for a <code>DefinitionKind</code> object.
  360. * @serial
  361. */
  362. private int _value;
  363. }