5.24.2 TypeCodeのメソッド
-
public org.omg.CORBA.TypeCode content_type( )
throws
org.omg.CORBA._TypeCodePackage.BadKind
このメソッドは,シーケンスや配列型またはエイリアス型に含まれる要素のタイプコードを返します。このメソッドは,次のタイプコードの場合有効です。
-
tk_sequence
-
tk_array
-
tk_alias
BAD_PARAM例外は,タイプコードが上記のどれでもない場合に発生します。
-
-
throws
org.omg.CORBA._TypeCodePackage.BadKind
このメソッドは,unionのデフォルトインデックスを返します。このメソッドは,タイプコードtk_unionのオブジェクトの場合だけ有効です。そうでない場合,BAD_PARAM例外が発生します。
-
public TypeCode discriminator_type( )
throws
org.omg.CORBA._TypeCodePackage.BadKind
このメソッドは,unionのディスクリミネータのタイプコードを返します。このメソッドは,tk_unionのタイプコードでオブジェクトを呼び出す場合だけ有効です。そうでない場合は,BAD_PARAM例外が発生します。
-
org.omg.CORBA.TypeCode tc)
このメソッドは,このオブジェクトがtcと同等である場合にtrueを返します。そうでない場合,falseを返します。型が同じであるかどうかは,名前ではなく型の構造体によって判定されます。同じ順序で宣言された同じフィールドの二つの構造体は,型が同じであるとみなされます。
-
tc
このオブジェクト型と比較されるTypeCode
-
-
throws
org.omg.CORBA._TypeCodePackage.BadKind
このメソッドは,タイプコードのリポジトリIDを返します。この文字列はIDLに使用され,型を定義します。
-
このメソッドは,このタイプコードに対応する型の種類を返します。タイプコード種類定数は,TCKindで定義されます。詳細については,「5.23 TCKind」を参照してください。
-
throws
org.omg.CORBA._TypeCodePackage.BadKind
このメソッドは,型が含む要素数を返します。要素数がstringやsequenceのようにアンバウンデッドであれば,0を返します。このメソッドは,次のタイプコードの場合有効です。
-
tk_string
-
tk_sequence
-
tk_array
タイプコードが上記のどれでもない場合,BAD_PARAM例外が発生します。
-
-
throws
org.omg.CORBA._TypeCodePackage.BadKind
このメソッドは,型が保持しているメンバ数を返します。このメソッドは,次のタイプコードの場合有効です。
-
tk_struct
-
tk_union
-
tk_enum
-
tk_except
タイプコードが上記のどれでもない場合,BAD_PARAM例外が発生します。
-
-
int index)
throws
org.omg.CORBA._TypeCodePackage.BadKind,
org.omg.CORBA._TypeCodePackage.Bounds
このメソッドは,指定されたインデックスのあるメンバに対応するケースステートメントのラベルを返します。このメソッドは,タイプコードtk_unionの場合だけ有効で,そうでない場合は,BAD_PARAM例外が発生します。インデックスがバウンド外である場合,Bounds例外が発生します。
-
index
ラベルが返されるメンバのインデックス
-
-
int index)
throws
org.omg.CORBA._TypeCodePackage.BadKind,
org.omg.CORBA._TypeCodePackage.Bounds
このメソッドは,指定されたインデックスのあるメンバ名を返します。
このメソッドは,次のタイプコードの場合有効です。
-
tk_struct
-
tk_union
-
tk_enum
-
tk_except
タイプコードが上記のどれでもない場合,BAD_PARAM例外が発生します。インデックスがバウンド外である場合,Bounds例外が発生します。
-
index
名前が返されるメンバのインデックス
-
-
public org.omg.CORBA.TypeCode member_type(
int index)
throws
org.omg.CORBA._TypeCodePackage.BadKind,
org.omg.CORBA._TypeCodePackage.Bounds
このメソッドは,指定されたインデックスのあるメンバのタイプコードを返します。このメソッドは,次のタイプコードの場合有効です。
-
tk_struct
-
tk_union
-
tk_except
タイプコードが上記のどれでもない場合,BAD_PARAM例外が発生します。インデックスがバウンド外である場合,Bounds例外が発生します。
-
index
タイプコードが返されるメンバのインデックス
-
-
throws
org.omg.CORBA._TypeCodePackage.BadKind
このメソッドは,アンスコープ型名を返します。このメソッドは,次のタイプコードの場合有効です。
-
tk_objref
-
tk_struct
-
tk_union
-
tk_enum
-
tk_alias
-
tk_except
タイプコードが上記のどれでもない場合,BAD_PARAM例外が発生します。
-