本文整理汇总了Java中com.jacob.com.Variant.VariantShort方法的典型用法代码示例。如果您正苦于以下问题:Java Variant.VariantShort方法的具体用法?Java Variant.VariantShort怎么用?Java Variant.VariantShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jacob.com.Variant
的用法示例。
在下文中一共展示了Variant.VariantShort方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFieldValueAsInt
import com.jacob.com.Variant; //导入方法依赖的package包/类
public Integer getFieldValueAsInt(String field) {
Variant res = getFieldValueAsVariant(field);
if (res != null) {
if (res.getvt() != Variant.VariantInt
&& res.getvt() != Variant.VariantLongInt
&& res.getvt() != Variant.VariantShort)
System.err.println("Field is not an int type " + field + " "
+ res.getvt());
if (res.isNull()) {
return null;
}
int value = res.getInt();
return Integer.valueOf(value);
}
return null;
}
示例2: toStringType
import com.jacob.com.Variant; //导入方法依赖的package包/类
/**
* translate a short Variant Type Defintion to a String (string,empty,null,short ...)
* @param type
* @return String Variant Type
*/
public static String toStringType(short type) {
if(type==Variant.VariantEmpty) return "empty";
else if(type==Variant.VariantNull) return "null";
else if(type==Variant.VariantShort) return "Short";
else if(type==Variant.VariantInt) return "Integer";
else if(type==Variant.VariantFloat) return "Float";
else if(type==Variant.VariantDouble) return "Double";
else if(type==Variant.VariantCurrency) return "Currency";
else if(type==Variant.VariantDate) return "Date";
else if(type==Variant.VariantString) return "String";
else if(type==Variant.VariantBoolean) return "Boolean";
else if(type==Variant.VariantByte) return "Byte";
else if(type==Variant.VariantArray) return "Array";
else if(type==Variant.VariantDispatch) return "Dispatch";
else if(type==Variant.VariantByref) return "Byref";
else if(type==Variant.VariantCurrency) return "Currency";
else if(type==Variant.VariantError) return "Error";
else if(type==Variant.VariantInt) return "int";
else if(type==Variant.VariantObject) return "Object";
else if(type==Variant.VariantTypeMask) return "TypeMask";
else if(type==Variant.VariantVariant) return "Variant";
else return "unknow";
}