|
VisiBroker for Java |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DynUnionOperations
DynUnion
objects are associated with unions.
The DynUnion
interface allows for the insertion/extraction
of an OMG IDL union type into/from a DynUnion
object.
A union can have only two valid current positions: zero, which denotes the
discriminator, and one, which denotes the active member. The component_count
value for a union depends on the current discriminator: it is 2 for a union whose
discriminator indicates a named member, and 1 otherwise.
Method Summary | |
---|---|
TCKind |
discriminator_kind()
The discriminator_kind operation returns the TCKind value of the discriminator?s TypeCode. |
DynAny |
get_discriminator()
The get_discriminator operation returns the current discriminator value of the DynUnion. |
boolean |
has_no_active_member()
The has_no_active_member operation returns true if the union has no active member (that is, the union's value consists solely of its discriminator because the discriminator has a value that is not listed as an explicit case label). |
TCKind |
member_kind()
The member_kind operation returns the TCKind value of the TypeCode of the currently active member. |
java.lang.String |
member_name()
The member_name operation returns the name of the currently active member. |
DynAny |
member()
The member operation returns the currently active member. |
void |
set_discriminator(DynAny d)
The set_discriminator operation sets the discriminator of the DynUnion to the
specified value. |
void |
set_to_default_member()
The set_to_default_member operation sets the discriminator to a value that is consistent with the value of the default case of a union; it sets the current position to zero and causes component_count to return 2. |
void |
set_to_no_active_member()
The set_to_no_active_member operation sets the discriminator to a value that does not correspond to any of the union?s case labels; it sets the current position to zero and causes component_count to return 1. |
Methods inherited from interface org.omg.DynamicAny.DynAnyOperations |
---|
assign, component_count, copy, current_component, destroy, equal, from_any, get_any, get_boolean, get_char, get_double, get_dyn_any, get_float, get_long, get_longlong, get_octet, get_reference, get_short, get_string, get_typecode, get_ulong, get_ulonglong, get_ushort, get_val, get_wchar, get_wstring, insert_any, insert_boolean, insert_char, insert_double, insert_dyn_any, insert_float, insert_long, insert_longlong, insert_octet, insert_reference, insert_short, insert_string, insert_typecode, insert_ulong, insert_ulonglong, insert_ushort, insert_val, insert_wchar, insert_wstring, next, rewind, seek, to_any, type |
Method Detail |
---|
TCKind member_kind() throws InvalidValue
InvalidValue
java.lang.String member_name() throws InvalidValue
InvalidValue
DynAny member() throws InvalidValue
InvalidValue
TCKind discriminator_kind()
boolean has_no_active_member()
void set_to_no_active_member() throws TypeMismatch
TypeMismatch
.
TypeMismatch
void set_to_default_member() throws TypeMismatch
TypeMismatch
.
TypeMismatch
void set_discriminator(DynAny d) throws TypeMismatch
DynUnion
to the
specified value. If the TypeCode of the d parameter is not equivalent to the
TypeCode of the union's discriminator, the operation raises TypeMismatch
.
Setting the discriminator to a value that is consistent with the currently active union
member does not affect the currently active member. Setting the discriminator to a
value that is inconsistent with the currently active member deactivates the member and
activates the member that is consistent with the new discriminator value (if there is a
member for that value) by initializing the member to its default value.
Setting the discriminator of a union sets the current position to 0 if the discriminator
value indicates a non-existent union member (has_no_active_member returns true
in this case). Otherwise, if the discriminator value indicates a named union member,
the current position is set to 1 (has_no_active_member returns false and
component_count returns 2 in this case).
TypeMismatch
DynAny get_discriminator()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |