本文整理汇总了Java中org.omg.CORBA.TCKind._tk_union方法的典型用法代码示例。如果您正苦于以下问题:Java TCKind._tk_union方法的具体用法?Java TCKind._tk_union怎么用?Java TCKind._tk_union使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.omg.CORBA.TCKind
的用法示例。
在下文中一共展示了TCKind._tk_union方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: id
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public String id()
throws BadKind
{
switch (_kind) {
case tk_indirect:
//return indirectType().id(); // same as _id
case TCKind._tk_except:
case TCKind._tk_objref:
case TCKind._tk_struct:
case TCKind._tk_union:
case TCKind._tk_enum:
case TCKind._tk_alias:
case TCKind._tk_value:
case TCKind._tk_value_box:
case TCKind._tk_native:
case TCKind._tk_abstract_interface:
// exception and objref typecodes must have a repository id.
// structs, unions, enums, and aliases may or may not.
return _id;
default:
// all other typecodes throw the BadKind exception.
throw new BadKind();
}
}
示例2: currentUnionMemberIndex
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
int currentUnionMemberIndex(Any discriminatorValue) throws BadKind {
if (_kind != TCKind._tk_union)
throw new BadKind();
try {
for (int i=0; i<member_count(); i++) {
if (member_label(i).equal(discriminatorValue)) {
return i;
}
}
if (_defaultIndex != -1) {
return _defaultIndex;
}
} catch (BadKind bad) {
} catch (org.omg.CORBA.TypeCodePackage.Bounds bounds) {
}
return -1;
}
示例3: member_name
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public String member_name(int index)
throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds
{
switch (_kind) {
case tk_indirect:
return indirectType().member_name(index);
case TCKind._tk_except:
case TCKind._tk_struct:
case TCKind._tk_union:
case TCKind._tk_enum:
case TCKind._tk_value:
try {
return _memberNames[index];
} catch (ArrayIndexOutOfBoundsException e) {
throw new org.omg.CORBA.TypeCodePackage.Bounds();
}
default:
throw new BadKind();
}
}
示例4: member_type
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public TypeCode member_type(int index)
throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds
{
switch (_kind) {
case tk_indirect:
return indirectType().member_type(index);
case TCKind._tk_except:
case TCKind._tk_struct:
case TCKind._tk_union:
case TCKind._tk_value:
try {
return _memberTypes[index];
} catch (ArrayIndexOutOfBoundsException e) {
throw new org.omg.CORBA.TypeCodePackage.Bounds();
}
default:
throw new BadKind();
}
}
示例5: member_label
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public Any member_label(int index)
throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds
{
switch (_kind) {
case tk_indirect:
return indirectType().member_label(index);
case TCKind._tk_union:
try {
// _REVISIT_ Why create a new Any for this?
return new AnyImpl(_orb, _unionLabels[index]);
} catch (ArrayIndexOutOfBoundsException e) {
throw new org.omg.CORBA.TypeCodePackage.Bounds();
}
default:
throw new BadKind();
}
}
示例6: name
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public String name()
throws BadKind
{
switch (_kind) {
case tk_indirect:
return indirectType().name();
case TCKind._tk_except:
case TCKind._tk_objref:
case TCKind._tk_struct:
case TCKind._tk_union:
case TCKind._tk_enum:
case TCKind._tk_alias:
case TCKind._tk_value:
case TCKind._tk_value_box:
case TCKind._tk_native:
case TCKind._tk_abstract_interface:
return _name;
default:
throw new BadKind();
}
}
示例7: member_count
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public int member_count()
throws BadKind
{
switch (_kind) {
case tk_indirect:
return indirectType().member_count();
case TCKind._tk_except:
case TCKind._tk_struct:
case TCKind._tk_union:
case TCKind._tk_enum:
case TCKind._tk_value:
return _memberCount;
default:
throw new BadKind();
}
}
示例8: TypeCodeImpl
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public TypeCodeImpl(ORB orb,
int creationKind,
String id,
String name,
TypeCode discriminator_type,
UnionMember[] members)
// for unions
{
this(orb) ;
if (creationKind == TCKind._tk_union) {
_kind = creationKind;
setId(id);
_name = name;
_memberCount = members.length;
_discriminator = convertToNative(_orb, discriminator_type);
_memberNames = new String[_memberCount];
_memberTypes = new TypeCodeImpl[_memberCount];
_unionLabels = new AnyImpl[_memberCount];
for (int i = 0 ; i < _memberCount ; i++) {
_memberNames[i] = members[i].name;
_memberTypes[i] = convertToNative(_orb, members[i].type);
_memberTypes[i].setParent(this);
_unionLabels[i] = new AnyImpl(_orb, members[i].label);
// check whether this is the default branch.
if (_unionLabels[i].type().kind() == TCKind.tk_octet) {
if (_unionLabels[i].extract_octet() == (byte)0) {
_defaultIndex = i;
}
}
}
} // else initializes to null
}
示例9: discriminator_type
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public TypeCode discriminator_type()
throws BadKind
{
switch (_kind) {
case tk_indirect:
return indirectType().discriminator_type();
case TCKind._tk_union:
return _discriminator;
default:
throw new BadKind();
}
}
示例10: default_index
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public int default_index()
throws BadKind
{
switch (_kind) {
case tk_indirect:
return indirectType().default_index();
case TCKind._tk_union:
return _defaultIndex;
default:
throw new BadKind();
}
}
示例11: create_union_tc
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public TypeCode create_union_tc(String id,
String name,
TypeCode discriminator_type,
UnionMember[] members)
{
return new TypeCodeImpl(this,
TCKind._tk_union,
id,
name,
discriminator_type,
members);
}
示例12: createMostDerivedDynAny
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
static DynAny createMostDerivedDynAny(TypeCode typeCode, ORB orb)
throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode
{
if (typeCode == null || ! DynAnyUtil.isConsistentType(typeCode))
throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode();
switch (typeCode.kind().value()) {
case TCKind._tk_sequence:
return new DynSequenceImpl(orb, typeCode);
case TCKind._tk_struct:
return new DynStructImpl(orb, typeCode);
case TCKind._tk_array:
return new DynArrayImpl(orb, typeCode);
case TCKind._tk_union:
return new DynUnionImpl(orb, typeCode);
case TCKind._tk_enum:
return new DynEnumImpl(orb, typeCode);
case TCKind._tk_fixed:
return new DynFixedImpl(orb, typeCode);
case TCKind._tk_value:
return new DynValueImpl(orb, typeCode);
case TCKind._tk_value_box:
return new DynValueBoxImpl(orb, typeCode);
default:
return new DynAnyBasicImpl(orb, typeCode);
}
}