Package com.sun.corba.ee.impl.dynamicany
Class DynEnumImpl
- java.lang.Object
-
- org.omg.CORBA.LocalObject
-
- com.sun.corba.ee.impl.dynamicany.DynAnyImpl
-
- com.sun.corba.ee.impl.dynamicany.DynAnyBasicImpl
-
- com.sun.corba.ee.impl.dynamicany.DynEnumImpl
-
- All Implemented Interfaces:
java.io.Serializable
,Object
,IDLEntity
,DynAny
,DynAnyOperations
,DynEnum
,DynEnumOperations
public class DynEnumImpl extends DynAnyBasicImpl implements DynEnum
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
currentEnumeratorIndex
private static long
serialVersionUID
-
Fields inherited from class com.sun.corba.ee.impl.dynamicany.DynAnyImpl
any, index, NO_INDEX, orb, status, STATUS_DESTROYABLE, STATUS_DESTROYED, STATUS_UNDESTROYABLE, wrapper
-
-
Constructor Summary
Constructors Modifier Constructor Description private
DynEnumImpl()
protected
DynEnumImpl(ORB orb, Any anAny, boolean copyValue)
protected
DynEnumImpl(ORB orb, TypeCode typeCode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
component_count()
Returns the number of components of a DynAny.private int
computeCurrentEnumeratorIndex(java.lang.String value)
DynAny
current_component()
Returns the DynAny for the component at the current position.java.lang.String
get_as_string()
Returns the value of the DynEnum as an IDL identifier.int
get_as_ulong()
Returns the value of the DynEnum as the enumerated value's ordinal value.private int
memberCount()
private java.lang.String
memberName(int i)
void
set_as_string(java.lang.String value)
Sets the value of the DynEnum to the enumerated value whose IDL identifier is passed in the value parameter.void
set_as_ulong(int value)
Sets the value of the DynEnum as the enumerated value's ordinal value.-
Methods inherited from class com.sun.corba.ee.impl.dynamicany.DynAnyBasicImpl
assign, copy, 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
-
Methods inherited from class com.sun.corba.ee.impl.dynamicany.DynAnyImpl
_ids, clearData, factory, getAny, getAny, setStatus, type, writeAny
-
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface, _get_interface_def, _get_policy, _hash, _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, 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
-
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
currentEnumeratorIndex
int currentEnumeratorIndex
-
-
Method Detail
-
memberCount
private int memberCount()
-
memberName
private java.lang.String memberName(int i)
-
computeCurrentEnumeratorIndex
private int computeCurrentEnumeratorIndex(java.lang.String value)
-
component_count
public int component_count()
Description copied from interface:DynAnyOperations
Returns the number of components of a DynAny. For a DynAny without components, it returns zero. The operation only counts the components at the top level. For example, if component_count is invoked on a DynStruct with a single member, the return value is 1, irrespective of the type of the member.- For sequences, the operation returns the current number of elements.
- For structures, exceptions, and value types, the operation returns the number of members.
- For arrays, the operation returns the number of elements.
- For unions, the operation returns 2 if the discriminator indicates that a named member is active, otherwise, it returns 1.
- For DynFixed and DynEnum, the operation returns zero.
- Specified by:
component_count
in interfaceDynAnyOperations
- Overrides:
component_count
in classDynAnyBasicImpl
- Returns:
- the number of components
-
current_component
public DynAny current_component() throws TypeMismatch
Description copied from interface:DynAnyOperations
Returns the DynAny for the component at the current position. It does not advance the current position, so repeated calls to current_component without an intervening call to rewind, next, or seek return the same component. The returned DynAny object reference can be used to get/set the value of the current component. If the current component represents a complex type, the returned reference can be narrowed based on the TypeCode to get the interface corresponding to the to the complex type. Calling current_component on a DynAny that cannot have components, such as a DynEnum or an empty exception, raises TypeMismatch. Calling current_component on a DynAny whose current position is -1 returns a nil reference. The iteration operations, together with current_component, can be used to dynamically compose an any value. After creating a dynamic any, such as a DynStruct, current_component and next can be used to initialize all the components of the value. Once the dynamic value is completely initialized, to_any creates the corresponding any value.- Specified by:
current_component
in interfaceDynAnyOperations
- Overrides:
current_component
in classDynAnyBasicImpl
- Returns:
- the DynAny at the current position
- Throws:
TypeMismatch
- If called on a DynAny that cannot have components, such as a DynEnum or an empty exception
-
get_as_string
public java.lang.String get_as_string()
Description copied from interface:DynEnumOperations
Returns the value of the DynEnum as an IDL identifier.- Specified by:
get_as_string
in interfaceDynEnumOperations
- Returns:
- the value of the DynEnum
-
set_as_string
public void set_as_string(java.lang.String value) throws InvalidValue
Description copied from interface:DynEnumOperations
Sets the value of the DynEnum to the enumerated value whose IDL identifier is passed in the value parameter.- Specified by:
set_as_string
in interfaceDynEnumOperations
- Parameters:
value
- the new enum value- Throws:
InvalidValue
- If value contains a string that is not a valid IDL identifier for the corresponding enumerated type
-
get_as_ulong
public int get_as_ulong()
Description copied from interface:DynEnumOperations
Returns the value of the DynEnum as the enumerated value's ordinal value. Enumerators have ordinal values 0 to n-1, as they appear from left to right in the corresponding IDL definition.- Specified by:
get_as_ulong
in interfaceDynEnumOperations
- Returns:
- the value of the DynEnum
-
set_as_ulong
public void set_as_ulong(int value) throws InvalidValue
Description copied from interface:DynEnumOperations
Sets the value of the DynEnum as the enumerated value's ordinal value.- Specified by:
set_as_ulong
in interfaceDynEnumOperations
- Parameters:
value
- the new ordinal value- Throws:
InvalidValue
- If value contains a value that is outside the range of ordinal values for the corresponding enumerated type
-
-