当前位置: 首页>>代码示例>>Java>>正文


Java Variant.isNull方法代码示例

本文整理汇总了Java中com.jacob.com.Variant.isNull方法的典型用法代码示例。如果您正苦于以下问题:Java Variant.isNull方法的具体用法?Java Variant.isNull怎么用?Java Variant.isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jacob.com.Variant的用法示例。


在下文中一共展示了Variant.isNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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();
    }
}
 
开发者ID:jonico,项目名称:core,代码行数:17,代码来源:Requirement.java

示例2: getReferencedFieldAsIntArray

import com.jacob.com.Variant; //导入方法依赖的package包/类
public Integer[] getReferencedFieldAsIntArray(String fieldName,
        String subFieldName) {
    List<Integer> result = new ArrayList<Integer>();
    Variant res = Dispatch.call(this, "Field", fieldName);
    if (!res.isNull()) {
        assert (res.getvt() == Variant.VariantDispatch);
        Dispatch list = res.getDispatch();
        Variant listSize = Dispatch.call(list, "Count");
        assert (listSize.getvt() == Variant.VariantInt);
        int numItems = listSize.getInt();
        for (int i = 1; i <= numItems; i++) {
            Variant itemObj = Dispatch.call(list, "Item", i);
            assert (itemObj.getvt() == Variant.VariantDispatch);
            Dispatch subfield = itemObj.getDispatch();
            Variant subFieldVal = Dispatch.call(subfield, subFieldName);
            assert (subFieldVal.getvt() == Variant.VariantInt);
            if (!subFieldVal.isNull()) {
                result.add(subFieldVal.getInt());
            }
        }
    }
    return result.toArray(new Integer[] {});
}
 
开发者ID:jonico,项目名称:core,代码行数:24,代码来源:Requirement.java

示例3: getReferencedFieldAsStringArray

import com.jacob.com.Variant; //导入方法依赖的package包/类
public String[] getReferencedFieldAsStringArray(String fieldName,
        String subFieldName) {
    List<String> result = new ArrayList<String>();
    Variant res = Dispatch.call(this, "Field", fieldName);
    if (!res.isNull()) {
        assert (res.getvt() == Variant.VariantDispatch);
        Dispatch list = res.getDispatch();
        Variant listSize = Dispatch.call(list, "Count");
        assert (listSize.getvt() == Variant.VariantInt);
        int numItems = listSize.getInt();
        for (int i = 1; i <= numItems; i++) {
            Variant itemObj = Dispatch.call(list, "Item", i);
            assert (itemObj.getvt() == Variant.VariantDispatch);
            Dispatch subfield = itemObj.getDispatch();
            Variant subFieldVal = Dispatch.call(subfield, subFieldName);
            assert (subFieldVal.getvt() == Variant.VariantString);
            if (!subFieldVal.isNull()) {
                result.add(subFieldVal.getString());
            }
        }
    }
    return result.toArray(new String[] {});
}
 
开发者ID:jonico,项目名称:core,代码行数:24,代码来源:Requirement.java

示例4: 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;
}
 
开发者ID:jonico,项目名称:core,代码行数:17,代码来源:RecordSet.java

示例5: 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;
}
 
开发者ID:jonico,项目名称:core,代码行数:16,代码来源:Requirement.java

示例6: 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();
    }
}
 
开发者ID:jonico,项目名称:core,代码行数:14,代码来源:Requirement.java

示例7: 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;
}
 
开发者ID:jonico,项目名称:core,代码行数:16,代码来源:RecordSet.java

示例8: 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;
}
 
开发者ID:jonico,项目名称:core,代码行数:14,代码来源:RecordSet.java

示例9: 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 {
        ddate = res.getDate();
    }
    Date d = DateUtilities.convertWindowsTimeToDate(ddate);
    return d;
}
 
开发者ID:jonico,项目名称:core,代码行数:12,代码来源:Bug.java

示例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();
    }
}
 
开发者ID:jonico,项目名称:core,代码行数:9,代码来源:Bug.java

示例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();
    }
}
 
开发者ID:jonico,项目名称:core,代码行数:12,代码来源:Bug.java

示例12: getReferencedFieldAsString

import com.jacob.com.Variant; //导入方法依赖的package包/类
/**
 * Support for values that are not directly contained in this Bug, but are
 * instead determined via a separate, referenced object (i.e. a joined table
 * at the DB level). Values for these fields must be indirectly obtained by
 * first obtaining a separate COM object for the referenced field, and then
 * calling a direct property-get on that object. Concrete example: Bug
 * release and cycle info
 * 
 * @param fieldName
 *            name of the referenced field (e.g. BG_DETECTED_IN_REL)
 * @param subFieldName
 *            (sub) field in the referenced field whose value you want
 * @return value from the referenced object as a String
 */
public String getReferencedFieldAsString(String fieldName,
        String subFieldName) {
    String val = null;
    Variant res = Dispatch.call(this, "Field", fieldName);
    if (!res.isNull()) {
        Dispatch subfield = res.getDispatch();
        Variant subfieldVal = Dispatch.call(subfield, subFieldName);
        if (!subfieldVal.isNull()) {
            // NOTE: assuming that getString works for datetimes/numbers too
            val = subfieldVal.getString();
        }
    }
    return val;
}
 
开发者ID:jonico,项目名称:core,代码行数:29,代码来源:Bug.java

示例13: add

import com.jacob.com.Variant; //导入方法依赖的package包/类
public Stock add(String ticker) {
	Variant vStock = Dispatch.call(dStocks, "Add", new Variant(ticker));
	
	return !vStock.isNull() ? new Stock(vStock.toDispatch()) : null;
}
 
开发者ID:jagin,项目名称:jamibroker,代码行数:6,代码来源:JAmiBroker.java

示例14: item

import com.jacob.com.Variant; //导入方法依赖的package包/类
public Stock item(String ticker) {
	Variant vStock =  Dispatch.call(dStocks, "Item", new Variant(ticker));
	
	return !vStock.isNull() ? new Stock(vStock.toDispatch()) : null;
}
 
开发者ID:jagin,项目名称:jamibroker,代码行数:6,代码来源:JAmiBroker.java

示例15: open

import com.jacob.com.Variant; //导入方法依赖的package包/类
public AnalysisDoc open(String fileName) {
	Variant vResult = Dispatch.call(dAnalysisDocs, "Open", 
			new Variant(fileName));
	return !vResult.isNull() ? new AnalysisDoc(vResult.toDispatch()) : null;
}
 
开发者ID:jagin,项目名称:jamibroker,代码行数:6,代码来源:JAmiBroker.java


注:本文中的com.jacob.com.Variant.isNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。