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