本文整理汇总了Java中org.omg.DynamicAny.DynFixed类的典型用法代码示例。如果您正苦于以下问题:Java DynFixed类的具体用法?Java DynFixed怎么用?Java DynFixed使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DynFixed类属于org.omg.DynamicAny包,在下文中一共展示了DynFixed类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assign
import org.omg.DynamicAny.DynFixed; //导入依赖的package包/类
public void assign(org.omg.DynamicAny.DynAny dyn_any)
throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch
{
if (dyn_any == null)
throw new BAD_PARAM("Null DynAny reference", 0,
CompletionStatus.COMPLETED_NO);
if (m_destroyed)
throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0,
CompletionStatus.COMPLETED_NO);
if (!m_base_type.equivalent(dyn_any.type()))
throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
try {
set_value(((DynFixed) dyn_any).get_value());
}
catch (InvalidValue iv) {
throw new BAD_PARAM("Invalid value");
}
catch (ClassCastException cce) {
throw new BAD_PARAM("Not a DynFixed value");
}
}
示例2: equal
import org.omg.DynamicAny.DynFixed; //导入依赖的package包/类
public boolean equal(org.omg.DynamicAny.DynAny dyn_any)
{
if (dyn_any == null)
throw new BAD_PARAM("Null DynAny reference", 0,
CompletionStatus.COMPLETED_NO);
if (m_destroyed)
throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0,
CompletionStatus.COMPLETED_NO);
if (!m_base_type.equivalent(dyn_any.type()))
return false;
if (dyn_any instanceof DynFixed) {
return fixed_value.equals(
new BigDecimal(new String(((DynFixed) dyn_any).get_value())));
} else { // invalid error
throw new BAD_PARAM("dyn_any value does not instantiate DynFixed!"
+ " but its type is fixed;");
}
}
示例3: create_fixed
import org.omg.DynamicAny.DynFixed; //导入依赖的package包/类
/**
* Create fixed.
*
* @param official the type that was originally passed as a parameter by user.
* May be alias of some other type.
* @param type the type into that the "official type" evaluates during alias
* resolving. Initially equal to "official type".
*/
public DynFixed create_fixed(TypeCode official, TypeCode type)
{
return new gnuDynFixed(official, type, this, orb);
}