1. package org.omg.DynamicAny;
  2. /**
  3. * org/omg/DynamicAny/DynUnionOperations.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.2"
  5. * from ../../../../src/share/classes/org/omg/DynamicAny/DynamicAny.idl
  6. * Wednesday, September 15, 2004 10:28:49 AM GMT
  7. */
  8. /**
  9. * DynUnion objects support the manipulation of IDL unions.
  10. * A union can have only two valid current positions:
  11. * <UL>
  12. * <LI>zero, which denotes the discriminator
  13. * <LI>one, which denotes the active member
  14. * </UL>
  15. * The component_count value for a union depends on the current discriminator:
  16. * it is 2 for a union whose discriminator indicates a named member, and 1 otherwise.
  17. */
  18. public interface DynUnionOperations extends org.omg.DynamicAny.DynAnyOperations
  19. {
  20. /**
  21. * Returns the current discriminator value.
  22. */
  23. org.omg.DynamicAny.DynAny get_discriminator ();
  24. /**
  25. * Sets the discriminator of the DynUnion to the specified value.
  26. * Setting the discriminator to a value that is consistent with the currently active union member
  27. * does not affect the currently active member. Setting the discriminator to a value that is inconsistent
  28. * with the currently active member deactivates the member and activates the member that is consistent
  29. * with the new discriminator value (if there is a member for that value) by initializing the member
  30. * to its default value.
  31. * Setting the discriminator of a union sets the current position to 0 if the discriminator value
  32. * indicates a non-existent union member (has_no_active_member returns true in this case).
  33. * Otherwise, if the discriminator value indicates a named union member, the current position is set to 1
  34. * (has_no_active_member returns false and component_count returns 2 in this case).
  35. *
  36. * @exception TypeMismatch if the TypeCode of the parameter is not equivalent to the TypeCode
  37. * of the union's discriminator
  38. */
  39. void set_discriminator (org.omg.DynamicAny.DynAny d) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
  40. /**
  41. * Sets the discriminator to a value that is consistent with the value of the default case of a union.
  42. * It sets the current position to zero and causes component_count to return 2.
  43. *
  44. * @exception TypeMismatch if the union does not have an explicit default case
  45. */
  46. void set_to_default_member () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
  47. /**
  48. * Sets the discriminator to a value that does not correspond to any of the unions case labels.
  49. * It sets the current position to zero and causes component_count to return 1.
  50. *
  51. * @exception TypeMismatch if the union has an explicit default case or if it uses the entire range
  52. * of discriminator values for explicit case labels
  53. */
  54. void set_to_no_active_member () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
  55. /**
  56. * Returns true if the union has no active member, that is, the unions value consists solely
  57. * of its discriminator because the discriminator has a value that is not listed as an explicit case label.
  58. * Calling this operation on a union that has a default case returns false.
  59. * Calling this operation on a union that uses the entire range of discriminator values
  60. * for explicit case labels returns false.
  61. */
  62. boolean has_no_active_member ();
  63. /**
  64. * Returns the TCKind value of the discriminators TypeCode.
  65. */
  66. org.omg.CORBA.TCKind discriminator_kind ();
  67. /**
  68. * Returns the TCKind value of the currently active members TypeCode.
  69. *
  70. * @exception InvalidValue if the union does not have a currently active member
  71. */
  72. org.omg.CORBA.TCKind member_kind () throws org.omg.DynamicAny.DynAnyPackage.InvalidValue;
  73. /**
  74. * Returns the currently active member. Note that the returned reference remains valid only
  75. * for as long as the currently active member does not change. Using the returned reference
  76. * beyond the life time of the currently active member raises OBJECT_NOT_EXIST.
  77. *
  78. * @exception InvalidValue if the union has no active member
  79. */
  80. org.omg.DynamicAny.DynAny member () throws org.omg.DynamicAny.DynAnyPackage.InvalidValue;
  81. /**
  82. * Returns the name of the currently active member. If the unions TypeCode does not contain
  83. * a member name for the currently active member, the operation returns an empty string.
  84. *
  85. * @exception InvalidValue if the union has no active member
  86. */
  87. String member_name () throws org.omg.DynamicAny.DynAnyPackage.InvalidValue;
  88. } // interface DynUnionOperations