All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.omg.CORBA.TypeCode

java.lang.Object
   |
   +----org.omg.CORBA.TypeCode

public abstract class TypeCode
extends Object

IDL definition:
interface TypeCode {
exception Bounds {
};
exception BadKind {
};
boolean equal(
in ::CORBA::TypeCode tc
);
::CORBA::TCKind kind();
::CORBA::RepositoryId id(
)
raises(
::CORBA::TypeCode::BadKind
);
::CORBA::Identifier name(
)
raises(
::CORBA::TypeCode::BadKind
);
unsigned long member_count(
)
raises(
::CORBA::TypeCode::BadKind
);
::CORBA::Identifier member_name(
in unsigned long index
)
raises(
::CORBA::TypeCode::BadKind,
::CORBA::TypeCode::Bounds
);
::CORBA::TypeCode member_type(
in unsigned long index
)
raises(
::CORBA::TypeCode::BadKind,
::CORBA::TypeCode::Bounds
);
any member_label(
in unsigned long index
)
raises(
::CORBA::TypeCode::BadKind,
::CORBA::TypeCode::Bounds
);
::CORBA::TypeCode discriminator_type(
)
raises(
::CORBA::TypeCode::BadKind
);
long default_index(
)
raises(
::CORBA::TypeCode::BadKind
);
unsigned long length(
)
raises(
::CORBA::TypeCode::BadKind
);
::CORBA::TypeCode content_type(
)
raises(
::CORBA::TypeCode::BadKind
);
};

The TypeCode interface describes types defined in IDL. These types can be examined and created at runtime. They can also be passed as parameters in operations. Type codes are mostly used to describe the type of value being stored in an any object. Type codes are created via the ORB interface. Type codes for all build in types (e.g., float, etc.) are provided in the TCKind class.

See Also:
ORB, get_primitive_tc, Any, TCKind

Constructor Index

 o TypeCode()

Method Index

 o content_type()
Returns the type of contained elements of container types, or returns the aliased type.
 o default_index()
Returns the default index of the union.
 o discriminator_type()
Returns the type of the union discriminator.
 o equal(TypeCode)
Returns true if the type code is type equivalent to tc, false otherwise.
 o id()
Returns the repository identifier of the type code.
 o kind()
Returns the kind of the type code.
 o length()
Returns the number of elements contained by the type.
 o member_count()
Returns the number of member in the type.
 o member_label(int)
Returns the label of member index.
 o member_name(int)
Returns the name of member index.
 o member_type(int)
Returns the type of member index.
 o name()
Returns the unscoped type name.

Constructors

 o TypeCode
 public TypeCode()

Methods

 o equal
 public abstract boolean equal(TypeCode tc)
Returns true if the type code is type equivalent to tc, false otherwise. Type equivalence is determined by the structure of the types, not by their names. Thus two structures with the same fields (declared in the same order) are considered type equivalent.

Operation: ::CORBA::TypeCode::equal.

boolean equal(
in ::CORBA::TypeCode tc
);

Parameters:
tc - The type code being compared.
 o kind
 public abstract TCKind kind()
Returns the kind of the type code. Type code kind constants are defined in TCKind.

Operation: ::CORBA::TypeCode::kind.

::CORBA::TCKind kind();

See Also:
TCKind
 o id
 public abstract String id() throws BadKind
Returns the repository identifier of the type code. This is defined by the IDL used to define the type.

Operation: ::CORBA::TypeCode::id.

::CORBA::RepositoryId id(
)
raises(
::CORBA::TypeCode::BadKind
);

Throws: BadKind
If the type code does not have have a name.
 o name
 public abstract String name() throws BadKind
Returns the unscoped type name. This method is only valid for the following type code kinds: tk_objref, tk_struct, tk_union, tk_enum, tk_alias, and tk_except.

Operation: ::CORBA::TypeCode::name.

::CORBA::Identifier name(
)
raises(
::CORBA::TypeCode::BadKind
);

Throws: BadKind
If the type code is not one of the specified kinds.
 o member_count
 public abstract int member_count() throws BadKind
Returns the number of member in the type. This method is only valid for the following type code kinds: tk_struct, tk_union, tk_enum, and tk_except

Operation: ::CORBA::TypeCode::member_count.

unsigned long member_count(
)
raises(
::CORBA::TypeCode::BadKind
);

Throws: BadKind
If the type code is not one of the specified kinds.
 o member_name
 public abstract String member_name(int index) throws BadKind, Bounds
Returns the name of member index. This method is only valid for the following type code kinds: tk_struct, tk_union, tk_enum, and tk_except

Operation: ::CORBA::TypeCode::member_name.

::CORBA::Identifier member_name(
in unsigned long index
)
raises(
::CORBA::TypeCode::BadKind,
::CORBA::TypeCode::Bounds
);

Throws: BadKind
If the type code is not one of the specified kinds.
Throws: Bounds
If the index parameter is out of range.
 o member_type
 public abstract TypeCode member_type(int index) throws BadKind, Bounds
Returns the type of member index. This method is only valid for the following type code kinds: tk_struct, tk_union, and tk_except

Operation: ::CORBA::TypeCode::member_type.

::CORBA::TypeCode member_type(
in unsigned long index
)
raises(
::CORBA::TypeCode::BadKind,
::CORBA::TypeCode::Bounds
);

Throws: BadKind
If the type code is not one of the specified kinds.
Throws: Bounds
If the index parameter is out of range.
 o member_label
 public abstract Any member_label(int index) throws BadKind, Bounds
Returns the label of member index. E.g., the label of the case statement. This method is only valid for the following type code kinds: tk_union

Operation: ::CORBA::TypeCode::member_label.

any member_label(
in unsigned long index
)
raises(
::CORBA::TypeCode::BadKind,
::CORBA::TypeCode::Bounds
);

Throws: BadKind
If the type code is not one of the specified kinds.
Throws: Bounds
If the index parameter is out of range.
 o discriminator_type
 public abstract TypeCode discriminator_type() throws BadKind
Returns the type of the union discriminator. This method is only valid for the following type code kinds: tk_union

Operation: ::CORBA::TypeCode::discriminator_type.

::CORBA::TypeCode discriminator_type(
)
raises(
::CORBA::TypeCode::BadKind
);

Throws: BadKind
If the type code is not one of the specified kinds.
 o default_index
 public abstract int default_index() throws BadKind
Returns the default index of the union. This method is only valid for the following type code kinds: tk_union

Operation: ::CORBA::TypeCode::default_index.

long default_index(
)
raises(
::CORBA::TypeCode::BadKind
);

Throws: BadKind
If the type code is not one of the specified kinds.
 o length
 public abstract int length() throws BadKind
Returns the number of elements contained by the type. Returns zero if the number of elements is unbounded, for strings and sequences. This method is only valid for the following type code kinds: tk_string, tk_sequence, and tk_array

Operation: ::CORBA::TypeCode::length.

unsigned long length(
)
raises(
::CORBA::TypeCode::BadKind
);

Throws: BadKind
If the type code is not one of the specified kinds.
 o content_type
 public abstract TypeCode content_type() throws BadKind
Returns the type of contained elements of container types, or returns the aliased type. This method is only valid for the following type code kinds: tk_sequence, tk_array, and tk_alias

Operation: ::CORBA::TypeCode::content_type.

::CORBA::TypeCode content_type(
)
raises(
::CORBA::TypeCode::BadKind
);

Throws: BadKind
If the type code is not one of the specified kinds.

All Packages  Class Hierarchy  This Package  Previous  Next  Index