org.jacorb.orb.dynany
Class DynUnion

java.lang.Object
  extended byorg.omg.CORBA.LocalObject
      extended byorg.jacorb.orb.dynany.DynAny
          extended byorg.jacorb.orb.dynany.DynUnion
All Implemented Interfaces:
DynAny, DynAnyOperations, DynUnion, DynUnionOperations, IDLEntity, Object, java.io.Serializable

public final class DynUnion
extends DynAny
implements DynUnion

CORBA DynUnion

Author:
(c) Gerald Brose, FU Berlin 1999 $Id: DynUnion.java,v 1.24 2005/03/25 13:15:55 andre.spiegel Exp $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jacorb.orb.dynany.DynAny
dynFactory, limit, orb, pos, type
 
Method Summary
 int component_count()
          Overrides component_count() in DynAny
 DynAny current_component()
           
 void destroy()
           
 TCKind discriminator_kind()
           
 boolean equal(DynAny dyn_any)
          Overrides equal() in DynAny
 void from_any(Any value)
          Overrides from_any() in DynAny
 DynAny get_discriminator()
           
 boolean has_no_active_member()
           
 TCKind member_kind()
           
 java.lang.String member_name()
           
 DynAny member()
           
 boolean next()
          Overrides next() in DynAny
 boolean seek(int index)
          Overrides seek() in DynAny
 void set_discriminator(DynAny d)
          sets the discriminator to d
 void set_to_default_member()
          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()
          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.
 Any to_any()
           
 
Methods inherited from class org.jacorb.orb.dynany.DynAny
assign, checkDestroyed, copy, 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, getRepresentation, 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, rewind, type
 
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _ids, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.omg.DynamicAny.DynAnyOperations
assign, copy, 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_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_wchar, insert_wstring, rewind, type
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Method Detail

from_any

public void from_any(Any value)
              throws InvalidValue,
                     TypeMismatch
Overrides from_any() in DynAny

Specified by:
from_any in interface DynAnyOperations
Overrides:
from_any in class DynAny
Throws:
InvalidValue
TypeMismatch

to_any

public Any to_any()
Specified by:
to_any in interface DynAnyOperations
Overrides:
to_any in class DynAny
Returns:
an Any that holds a copy of this union

component_count

public int component_count()
Overrides component_count() in DynAny

Specified by:
component_count in interface DynAnyOperations
Overrides:
component_count in class DynAny

next

public boolean next()
Overrides next() in DynAny

Specified by:
next in interface DynAnyOperations
Overrides:
next in class DynAny

seek

public boolean seek(int index)
Overrides seek() in DynAny

Specified by:
seek in interface DynAnyOperations
Overrides:
seek in class DynAny

equal

public boolean equal(DynAny dyn_any)
Overrides equal() in DynAny

Specified by:
equal in interface DynAnyOperations
Overrides:
equal in class DynAny

get_discriminator

public DynAny get_discriminator()
Specified by:
get_discriminator in interface DynUnionOperations
Returns:
the current discriminator value

set_discriminator

public void set_discriminator(DynAny d)
                       throws TypeMismatch
sets the discriminator to d

Specified by:
set_discriminator in interface DynUnionOperations
Throws:
TypeMismatch - if the TypeCode of the d parameter is not equivalent to the TypeCode of the union's discriminator

set_to_default_member

public 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.

Specified by:
set_to_default_member in interface DynUnionOperations
Throws:
TypeMismatch - if the union does not have an explicit default case.

set_to_no_active_member

public void set_to_no_active_member()
                             throws TypeMismatch
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.

Specified by:
set_to_no_active_member in interface DynUnionOperations
Throws:
TypeMismatch - if the union has an explicit default case or uses the entire range of discriminator values for explicit case labels.

has_no_active_member

public boolean has_no_active_member()
Specified by:
has_no_active_member in interface DynUnionOperations
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). 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

public TCKind discriminator_kind()
Specified by:
discriminator_kind in interface DynUnionOperations
Returns:
the TCKind value of the discriminator's TypeCode.

member

public DynAny member()
              throws InvalidValue
Specified by:
member in interface DynUnionOperations
Returns:
the currently active member.
Throws:
InvalidValue - if the union has no active member

member_kind

public TCKind member_kind()
                   throws InvalidValue
Specified by:
member_kind in interface DynUnionOperations
Returns:
the TypeCode kind of the currently active member.
Throws:
InvalidValue - if the union has no active member

member_name

public java.lang.String member_name()
                             throws InvalidValue
Specified by:
member_name in interface DynUnionOperations
Returns:
the name of the currently active member.
Throws:
InvalidValue - if the union has no active member

destroy

public void destroy()
Specified by:
destroy in interface DynAnyOperations
Overrides:
destroy in class DynAny

current_component

public DynAny current_component()
Specified by:
current_component in interface DynAnyOperations
Overrides:
current_component in class DynAny