-
- All Superinterfaces:
- DynAnyOperations
- All Known Subinterfaces:
- DynUnion
- All Known Implementing Classes:
- _DynUnionStub
public interface DynUnionOperations extends DynAnyOperations
DynUnion objects support the manipulation of IDL unions. A union can have only two valid current positions:- zero, which denotes the discriminator
- one, which denotes the active member
-
-
Method Summary
Methods Modifier and Type Method and Description TCKind
discriminator_kind()
Returns the TCKind value of the discriminators TypeCode.DynAny
get_discriminator()
Returns the current discriminator value.boolean
has_no_active_member()
Returns true if the union has no active member, that is, the unions value consists solely of its discriminator because the discriminator has a value that is not listed as an explicit case label.TCKind
member_kind()
Returns the TCKind value of the currently active members TypeCode.String
member_name()
Returns the name of the currently active member.DynAny
member()
Returns the currently active member.void
set_discriminator(DynAny d)
Sets the discriminator of the DynUnion to the specified value.void
set_to_default_member()
Sets the discriminator to a value that is consistent with the value of the default case of a union.void
set_to_no_active_member()
Sets the discriminator to a value that does not correspond to any of the unions case labels.-
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
-
get_discriminator
DynAny get_discriminator()
Returns the current discriminator value.
-
set_discriminator
void set_discriminator(DynAny d) throws TypeMismatch
Sets the discriminator of the DynUnion to the specified value. 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).- Throws:
TypeMismatch
- if the TypeCode of the parameter is not equivalent to the TypeCode of the union's discriminator
-
set_to_default_member
void set_to_default_member() throws TypeMismatch
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.- Throws:
TypeMismatch
- if the union does not have an explicit default case
-
set_to_no_active_member
void set_to_no_active_member() throws TypeMismatch
Sets the discriminator to a value that does not correspond to any of the unions case labels. It sets the current position to zero and causes component_count to return 1.- Throws:
TypeMismatch
- if the union has an explicit default case or if it uses the entire range of discriminator values for explicit case labels
-
has_no_active_member
boolean has_no_active_member()
Returns true if the union has no active member, that is, the unions value consists solely of its discriminator because the discriminator has a value that is not listed as an explicit case label. Calling this operation on a union that has a default case returns false. Calling this operation on a union that uses the entire range of discriminator values for explicit case labels returns false.
-
discriminator_kind
TCKind discriminator_kind()
Returns the TCKind value of the discriminators TypeCode.
-
member_kind
TCKind member_kind() throws InvalidValue
Returns the TCKind value of the currently active members TypeCode.- Throws:
InvalidValue
- if the union does not have a currently active member
-
member
DynAny member() throws InvalidValue
Returns the currently active member. Note that the returned reference remains valid only for as long as the currently active member does not change. Using the returned reference beyond the life time of the currently active member raises OBJECT_NOT_EXIST.- Throws:
InvalidValue
- if the union has no active member
-
member_name
String member_name() throws InvalidValue
Returns the name of the currently active member. If the unions TypeCode does not contain a member name for the currently active member, the operation returns an empty string.- Throws:
InvalidValue
- if the union has no active member
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
22/11/2024 03:15:26 Cette version de la page est en cache (à la date du 22/11/2024 03:15:26) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 31/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-org/omg/DynamicAny/DynUnionOperations.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.