本文整理汇总了Java中org.omg.CORBA.TCKind._tk_enum方法的典型用法代码示例。如果您正苦于以下问题:Java TCKind._tk_enum方法的具体用法?Java TCKind._tk_enum怎么用?Java TCKind._tk_enum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.omg.CORBA.TCKind
的用法示例。
在下文中一共展示了TCKind._tk_enum方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TypeCodeImpl
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public TypeCodeImpl(ORB orb,
int creationKind,
String id,
String name,
String[] members)
// for enums
{
this(orb) ;
if (creationKind == TCKind._tk_enum)
{
_kind = creationKind;
setId(id);
_name = name;
_memberCount = members.length;
_memberNames = new String[_memberCount];
for (int i = 0 ; i < _memberCount ; i++)
_memberNames[i] = members[i];
} // else initializes to null
}
示例2: 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();
}
}
示例3: 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();
}
}
示例4: 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();
}
}
示例5: 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();
}
}
示例6: insert_long
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
/**
* See the description of the <a href="#anyOps">general Any operations.</a>
*/
public void insert_long(int l)
{
//debug.log ("insert_long");
// A long value is applicable to enums as well, so don't erase the enum type code
// in case it was initialized that way before.
int kind = realType().kind().value();
if (kind != TCKind._tk_long && kind != TCKind._tk_enum) {
typeCode = orb.get_primitive_tc(TCKind._tk_long);
}
value = l;
isInitialized = true;
}
示例7: isConstructedDynAny
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
static boolean isConstructedDynAny(DynAny dynAny) {
// DynFixed is constructed but not a subclass of DynAnyConstructedImpl
//return (dynAny instanceof DynAnyConstructedImpl);
int kind = dynAny.type().kind().value();
return (kind == TCKind._tk_sequence ||
kind == TCKind._tk_struct ||
kind == TCKind._tk_array ||
kind == TCKind._tk_union ||
kind == TCKind._tk_enum ||
kind == TCKind._tk_fixed ||
kind == TCKind._tk_value ||
kind == TCKind._tk_value_box);
}
示例8: createMostDerivedDynAny
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
static DynAny createMostDerivedDynAny(Any any, ORB orb, boolean copyValue)
throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode
{
if (any == null || ! DynAnyUtil.isConsistentType(any.type()))
throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode();
switch (any.type().kind().value()) {
case TCKind._tk_sequence:
return new DynSequenceImpl(orb, any, copyValue);
case TCKind._tk_struct:
return new DynStructImpl(orb, any, copyValue);
case TCKind._tk_array:
return new DynArrayImpl(orb, any, copyValue);
case TCKind._tk_union:
return new DynUnionImpl(orb, any, copyValue);
case TCKind._tk_enum:
return new DynEnumImpl(orb, any, copyValue);
case TCKind._tk_fixed:
return new DynFixedImpl(orb, any, copyValue);
case TCKind._tk_value:
return new DynValueImpl(orb, any, copyValue);
case TCKind._tk_value_box:
return new DynValueBoxImpl(orb, any, copyValue);
default:
return new DynAnyBasicImpl(orb, any, copyValue);
}
}
示例9: create_enum_tc
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
public TypeCode create_enum_tc(String id,
String name,
String[] members)
{
return new TypeCodeImpl(this, TCKind._tk_enum, id, name, members);
}
示例10: create_enum_tc
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
/**
* Create a TypeCode for an enum.
*
* @param id the logical id for the typecode.
* @param name the name for the typecode.
* @param members an array describing the members of the TypeCode.
* @return the requested TypeCode.
*/
public synchronized TypeCode create_enum_tc(String id,
String name,
String[] members)
{
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_enum, id, name, members);
}