org.jacorb.orb.dynany

Class DynUnion

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.22 2004/05/06 12:40:00 nicolas Exp $

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()
DynAny
member()
TCKind
member_kind()
String
member_name()
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()

Method Details

component_count

public int component_count()
Overrides component_count() in DynAny
Specified by:
component_count in interface DynAnyOperations


current_component

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


destroy

public void destroy()
Specified by:
destroy in interface DynAnyOperations


discriminator_kind

public TCKind discriminator_kind()
Specified by:
discriminator_kind in interface DynUnionOperations

Returns:
the TCKind value of the discriminator's TypeCode.


equal

public boolean equal(DynAny dyn_any)
Overrides equal() in DynAny
Specified by:
equal in interface DynAnyOperations


from_any

public void from_any(Any value)
            throws InvalidValue,
                   TypeMismatch
Overrides from_any() in DynAny
Specified by:
from_any in interface DynAnyOperations


get_discriminator

public DynAny get_discriminator()
Specified by:
get_discriminator in interface DynUnionOperations

Returns:
the current discriminator value


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.


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


next

public boolean next()
Overrides next() in DynAny
Specified by:
next in interface DynAnyOperations


seek

public boolean seek(int index)
Overrides seek() in DynAny
Specified by:
seek in interface DynAnyOperations


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.


to_any

public Any to_any()
Specified by:
to_any in interface DynAnyOperations

Returns:
an Any that holds a copy of this union