1. /*
  2. * @(#)SetOverrideType.java 1.4 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package org.omg.CORBA;
  8. public class SetOverrideType implements org.omg.CORBA.portable.IDLEntity {
  9. /**
  10. * The <code>int</code> constant for the enum value SET_OVERRIDE.
  11. */
  12. public static final int _SET_OVERRIDE = 0;
  13. /**
  14. * The <code>int</code> constant for the enum value ADD_OVERRIDE.
  15. */
  16. public static final int _ADD_OVERRIDE = 1;
  17. /**
  18. * The <code>SetOverrideType</code> constant for the enum value SET_OVERRIDE
  19. */
  20. public static final SetOverrideType SET_OVERRIDE = new SetOverrideType(_SET_OVERRIDE);
  21. /**
  22. * The <code>SetOverrideType</code> constant for the enum value ADD_OVERRIDE
  23. */
  24. public static final SetOverrideType ADD_OVERRIDE = new SetOverrideType(_ADD_OVERRIDE);
  25. /**
  26. * Retrieves the value of this <code>SetOverrideType</code> instance.
  27. *
  28. * @return the <code>int</code> for this <code>SetOverrideType</code> instance.
  29. */
  30. public int value() {
  31. return _value;
  32. }
  33. /**
  34. * Converts the given <code>int</code> to the corresponding
  35. * <code>SetOverrideType</code> instance.
  36. *
  37. * @param the <code>int</code> to convert. It must be one of
  38. * the <code>int</code> constants in the class
  39. * <code>SetOverrideType</code>.
  40. * @return the <code>SetOverrideType</code> instance whose value
  41. * matches the given <code>int</code>
  42. * @exception BAD_PARAM if the given <code>int</code> does not
  43. * match the value of
  44. * any <code>SetOverrideType</code> instance
  45. */
  46. public static SetOverrideType from_int(int i) throws org.omg.CORBA.BAD_PARAM
  47. {
  48. switch (i) {
  49. case _SET_OVERRIDE:
  50. return SET_OVERRIDE;
  51. case _ADD_OVERRIDE:
  52. return ADD_OVERRIDE;
  53. default:
  54. throw new org.omg.CORBA.BAD_PARAM();
  55. }
  56. }
  57. protected SetOverrideType(int _value){
  58. this._value = _value;
  59. }
  60. private int _value;
  61. }