java.lang.Objectorg.omg.CORBA.TypeCode
All Implemented Interfaces:
IDLEntity
Direct Known Subclasses:
TypeCodeImpl
TypeCode objects are used:
NamedValue objects are used to represent arguments and
return values. One of their components is an Any
object, which in turn has as one of its components a
TypeCode object.
The representation of a TypeCode object is opaque,
but abstractly, a TypeCode object consists of:
kind field, which is set to an instance
of the class TCKind
TypeCode object
describing the OMG IDL type 1ong has kind
TCKind.tk_long and no additional fields.
The TypeCode describing OMG IDL type
sequence<boolean, 10> has a kind field
with the value
TCKind.tk_sequence and also fields with the values
boolean and 10 for the
type of sequence elements and the length of the sequence.
TypeCode objects can be obtained in various ways:
Any.insert_X, where X is
a basic IDL type. This method creates a TypeCode object
for type X and assigns it to the Any object's
type field.
For example, the following creates a TypeCode
object for a string with a maximum of 30 characters:
org.omg.CORBA.TypeCode tcString = orb.create_string_tc(30);
The following creates a TypeCode
object for an array of five strings:
org.omg.CORBA.TypeCode tcArray = orb.create_array_tc( 5, TCKind.tk_string);
The following creates a TypeCode
object for an interface named "Account":
org.omg.CORBA.TypeCode tcInterface = orb.create_interface_tc( "thisId", "Account");
_type method
in Holder classes for user-defined
IDL types. These Holder classes are generated
by the idltojava compiler.
Most of the methods in the class TypeCode
are accessors, and the information contained in a TypeCode
object is specific to a particular type. Therefore, methods
must be invoked
only on the kind of type codes to which they apply. If an
accessor method
tries to access information from an inappropriate kind of
type code, it will throw
the exception TypeCodePackage.BadKind. For example,
if the method discriminator_type is called on anything
other than a union, it will throw BadKind
because only unions have a discriminator.
The following list shows which methods apply to which kinds of
type codes:
These methods may be invoked on all TypeCode kinds:
equal
kind
These methods may be invoked on objref, struct,
union, enum,
alias, exception, value,
value_box, native,
and abstract_interface:
id
name
These methods may be invoked on struct,
union, enum,
and exception:
member_count
member_name
These methods may be invoked on struct,
union, and exception:
member_type(int index)
These methods may be invoked on union:
member_label
discriminator_type
default_index
These methods may be invoked on string,
sequence, and array:
length
These methods may be invoked on alias,
sequence, array, and value_box:
content_type
Unlike other CORBA pseudo-objects, TypeCode
objects can be passed as general IDL parameters.
The methods parameter and param_count,
which are deprecated, are not mapped.
Java IDL extends the CORBA specification to allow all operations permitted
on a struct TypeCode to be permitted
on an exception TypeCode as well.
| Method from org.omg.CORBA.TypeCode Summary: |
|---|
| concrete_base_type, content_type, default_index, discriminator_type, equal, equivalent, fixed_digits, fixed_scale, get_compact_typecode, id, kind, length, member_count, member_label, member_name, member_type, member_visibility, name, type_modifier |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.omg.CORBA.TypeCode Detail: |
|---|
TypeCode object that describes the concrete base type
of the value type that this TypeCode object describes.
Returns null if it doesn't have a concrete base type. |
TypeCode object representing the
IDL type for the members of the object described by this
TypeCode object.
For sequences and arrays, it returns the
element type. For aliases, it returns the original type. Note
that multidimensional arrays are represented by nesting
TypeCode objects, one per dimension.
For boxed valuetypes, it returns the boxed type.
The method |
The method |
TypeCode object describing
all non-default member labels.
The method discriminator_type can be invoked only
on union TypeCode objects. |
TypeCode object with the given one,
testing for equality. TypeCode objects are equal if
they are interchangeable and give identical results when
TypeCode operations are applied to them. |
TypeCode object is
equivalent to this TypeCode object.
|
TypeCode object. For example, the typecode for
the number 3000.275d could be fixed<7,3>, where
7 is the precision and 3 is the scale. |
TypeCode object. A positive number indicates the
number of digits to the right of the decimal point.
For example, the number 3000d could have the
typecode fixed<4,0>, where the first number is
the precision and the second number is the scale.
A negative number is also possible and adds zeroes to the
left of the decimal point. In this case, fixed<1,-3>,
could be the typecode for the number 3000d. |
|
TypeCode object.
The method |
TypeCode object.
The kind of a type code determines which TypeCode
methods may legally be invoked on it.
The method |
TypeCode object.
For strings and sequences, it returns the
bound, with zero indicating an unbounded string or sequence.
For arrays, it returns the number of elements in the array.
The method |
TypeCode object.
The method |
The method |
TypeCode object
may not match the name of the member in any particular
Repository, and may even be an empty string.
The method |
TypeCode object describing the type
of the member identified by the given index.
The method |
TypeCode objects. |
TypeCode
object within its
enclosing scope. Since names are local to a Repository, the
name returned from a TypeCode object
may not match the name of the
type in any particular Repository, and may even be an empty
string.
The method |
TypeCode object describes. The constant
returned must be one of the following: VM_NONE.value,
VM_ABSTRACT.value, VM_CUSTOM.value,
or VM_TRUNCATABLE.value, |