本文整理汇总了Java中com.jacob.com.Variant.getvt方法的典型用法代码示例。如果您正苦于以下问题:Java Variant.getvt方法的具体用法?Java Variant.getvt怎么用?Java Variant.getvt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jacob.com.Variant
的用法示例。
在下文中一共展示了Variant.getvt方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFieldValueAsVariant
import com.jacob.com.Variant; //导入方法依赖的package包/类
private Variant getFieldValueAsVariant(String field) {
Variant res = Dispatch.call(this, "FieldValue", field);
if (res.getvt() == Variant.VariantEmpty) {
return null;
} else if (res.getvt() == Variant.VariantError) {
return null;
}
return res;
}
示例2: getFieldAsString
import com.jacob.com.Variant; //导入方法依赖的package包/类
public String getFieldAsString(String field) {
Variant res = Dispatch.call(this, "Field", field);
if (res.isNull()) {
return null;
} else if (res.getvt() == Variant.VariantInt) {
int val = res.getInt();
return Integer.toString(val);
} else if (res.getvt() == Variant.VariantDate) {
logger.warn("Field " + field
+ " should have contained a string but contained a date: "
+ res.getDate());
return null;
} else {
return res.getString();
}
}
示例3: 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;
}
示例4: getFieldAsDate
import com.jacob.com.Variant; //导入方法依赖的package包/类
public Date getFieldAsDate(String field) {
Variant res = Dispatch.call(this, "Field", field);
double ddate = 0.0;
if (res.isNull()) {
return null;
} else if (res.getvt() == Variant.VariantString) {
logger.warn("Field " + field
+ " should have contained a date but contained a string: "
+ res.getString());
} else {
ddate = res.getDate();
}
Date d = DateUtilities.convertWindowsTimeToDate(ddate);
return d;
}
示例5: getFieldAsInt
import com.jacob.com.Variant; //导入方法依赖的package包/类
public Integer getFieldAsInt(String field) {
Variant res = Dispatch.call(this, "Field", field);
if (res.isNull() || res.getvt() == Variant.VariantDispatch) {
return null;
} else if (res.getvt() == Variant.VariantString) {
logger.warn("Field " + field
+ " should have contained an int but contained a string: "
+ res.getString());
return null;
} else {
return res.getInt();
}
}
示例6: getVersionControlObject
import com.jacob.com.Variant; //导入方法依赖的package包/类
public IVersionControl getVersionControlObject() {
Variant result = null;
try {
result = getProperty("VC");
} catch (Exception e) {
; // do nothing
}
if (result == null || result.getvt() != Variant.VariantDispatch) {
return null;
} else {
Dispatch dispatch = result.getDispatch();
return new VersionControl(dispatch);
}
}
示例7: getColNameAsString
import com.jacob.com.Variant; //导入方法依赖的package包/类
public String getColNameAsString(int index) {
Variant res = Dispatch.call(this, "ColName", index);
if (res.getvt() != 8 && res.getvt() != 0)
System.err.println("Col Name is not a String type index:" + index
+ " " + res.getvt());
return res.getString();
}
示例8: getFieldValueAsDate
import com.jacob.com.Variant; //导入方法依赖的package包/类
public Date getFieldValueAsDate(String field) {
Variant res = getFieldValueAsVariant(field);
if (res != null) {
if (res.getvt() != Variant.VariantDate)
System.err.println("Field is not a Date type " + field + " "
+ res.getvt());
if (res.isNull()) {
return null;
}
double ddate = res.getDate();
Date date = DateUtilities.convertWindowsTimeToDate(ddate);
return date;
}
return null;
}
示例9: getFieldValueAsString
import com.jacob.com.Variant; //导入方法依赖的package包/类
public String getFieldValueAsString(String field) {
Variant res = getFieldValueAsVariant(field);
if (res != null) {
if (res.getvt() != Variant.VariantString)
System.err.println("Field is not a String type " + field + " "
+ res.getvt());
if (res.isNull()) {
return null;
}
return res.getString();
}
return null;
}
示例10: getFieldAsInt
import com.jacob.com.Variant; //导入方法依赖的package包/类
public Integer getFieldAsInt(String field) {
Variant res = Dispatch.call(this, "Field", field);
if (res.isNull() || res.getvt() == Variant.VariantDispatch) {
return null;
} else {
return res.getInt();
}
}
示例11: getFieldAsString
import com.jacob.com.Variant; //导入方法依赖的package包/类
public String getFieldAsString(String field) {
Variant res = Dispatch.call(this, "Field", field);
if (res.isNull()) {
return null;
} else if (res.getvt() == Variant.VariantInt) {
int val = res.getInt();
return Integer.toString(val);
} else {
return res.getString();
}
}
示例12: removeItem
import com.jacob.com.Variant; //导入方法依赖的package包/类
public void removeItem(String key) {
Variant res = Dispatch.call(this, "RemoveItem", key);
res.getvt();
}