• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ValueEval类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.poi.ss.formula.eval.ValueEval的典型用法代码示例。如果您正苦于以下问题:Java ValueEval类的具体用法?Java ValueEval怎么用?Java ValueEval使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ValueEval类属于org.apache.poi.ss.formula.eval包,在下文中一共展示了ValueEval类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: evaluate

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
@Override
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex,
		ValueEval arg0, ValueEval arg1, ValueEval arg2)
{
/*
	  try
	{
		ValueEval ve = OperandResolver.getSingleValue(arg0, srcRowIndex, srcColumnIndex);
	} catch (EvaluationException e)
	{
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

	*/
	//evalu
	return new NumberEval(2);
}
 
开发者ID:rodrigoEclipsa,项目名称:excelToApp,代码行数:19,代码来源:DAVERAGE.java


示例2: prepareQueryArgs

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
static List<ValueEval> prepareQueryArgs(List<ValueEval> queryArgs) throws EvaluationException {
    List<ValueEval> args = new LinkedList<>();
    
    for (ValueEval arg : queryArgs) {
        
        if (arg instanceof AreaEval) {
            AreaEval range = (AreaEval) arg;
            
            for (int i = range.getFirstRow(); i <= range.getLastRow(); i++) {
                for (int j = range.getFirstColumn(); j <= range.getLastColumn(); j++)
                    { args.add(getSingleValue(arg, i, j)); }
            }
        } else {
            args.add(arg);  
        }
    }
    
    return args;
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:20,代码来源:ICustomFunction.java


示例3: initialize

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
@Setup(Level.Trial)
public void initialize() throws Exception {
    String excelFile = "src/test/resources/datamodel/nativepoi/CalcEngine_vs_POI_" + cell_iterations + "times.xlsx";

    XSSFWorkbook wb = new XSSFWorkbook(excelFile);
    XSSFEvaluationWorkbook ewb = XSSFEvaluationWorkbook.create(wb);

    this.ccEvaluator = new SpreadsheetEvaluator(Converters.toDataModel(wb));
    this.poiEvaluator = new WorkbookEvaluator(ewb, IStabilityClassifier.TOTALLY_IMMUTABLE, null);

    this.ccExpectedValues = new Object[from + cell_iterations];
    for (int i = from; i < from + cell_iterations; i++)
        this.ccExpectedValues[i] = ccEvaluator.evaluate(fromA1Address(columnA + i)).getResult().get();

    this.poiExpectedValues = new ValueEval[from + cell_iterations - 1];
    for (int i = from - 1; i < from + cell_iterations - 1; i++)
        this.poiExpectedValues[i] = poiEvaluator.evaluate(ewb.getSheet(0).getCell(i, columnAIndex));

    this.addressA = new IA1Address[from + cell_iterations];
    for (int i = from; i < from + cell_iterations; i++)
        this.addressA[i] = fromA1Address(columnA + i);

    this.addressB = new EvaluationCell[from + cell_iterations - 1];
    for (int i = from - 1; i < from + cell_iterations - 1; i++)
        this.addressB[i] = ewb.getSheet(0).getCell(i, columnAIndex);
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:27,代码来源:CalcEngine_vs_POI_One_Formula_Test.java


示例4: initialize

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
@Setup(Level.Trial)
public void initialize() throws Exception {
    String excelFile = "src/test/resources/datamodel/nativepoi/CalcEngine_vs_POI_set" + cell_iterations + "formulas.xlsx";

    XSSFWorkbook wb = new XSSFWorkbook(excelFile);
    XSSFEvaluationWorkbook ewb = XSSFEvaluationWorkbook.create(wb);

    this.ccEvaluator = new SpreadsheetEvaluator(Converters.toDataModel(wb));
    this.poiEvaluator = new WorkbookEvaluator(ewb, IStabilityClassifier.TOTALLY_IMMUTABLE, null);

    this.ccExpectedValues = new Object[from + cell_iterations];
    for (int i = from; i < from + cell_iterations; i++)
        this.ccExpectedValues[i] = ccEvaluator.evaluate(fromA1Address(columnB + i)).getResult().get();

    this.poiExpectedValues = new ValueEval[from + cell_iterations - 1];
    for (int i = from - 1; i < from + cell_iterations - 1; i++)
        this.poiExpectedValues[i] = poiEvaluator.evaluate(ewb.getSheet(0).getCell(i, columnAIndex));

    this.addressA = new IA1Address[from + cell_iterations];
    for (int i = from; i < from + cell_iterations; i++)
        this.addressA[i] = fromA1Address(columnA + i);

    this.addressB = new EvaluationCell[from + cell_iterations - 1];
    for (int i = from - 1; i < from + cell_iterations - 1; i++)
        this.addressB[i] = ewb.getSheet(0).getCell(i, columnAIndex);
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:27,代码来源:CalcEngine_vs_POI_Formula_Set_Test.java


示例5: apachepoi_ExcelFile_ExecutionTimeIsOk

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
@Benchmark
public void apachepoi_ExcelFile_ExecutionTimeIsOk(CalcEngine_vs_POI_One_Formula_Test state, Blackhole bh) {
    for (int i = state.from - 1; i < state.from + state.cell_iterations - 1; i++) {
        ValueEval value = state.poiEvaluator.evaluate(state.addressB[i]);
        assertThat(value).isEqualTo(state.poiExpectedValues[i]); /* comment for better performance */
        bh.consume(value);
    }
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:9,代码来源:CalcEngine_vs_POI_One_Formula_Test.java


示例6: apachepoi_ExcelFile_ExecutionTimeIsOk

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
@Benchmark
public void apachepoi_ExcelFile_ExecutionTimeIsOk(CalcEngine_vs_POI_Formula_Set_Test state, Blackhole bh) {
    for (int i = state.from - 1; i < state.from + state.cell_iterations - 1; i++) {
        ValueEval value = state.poiEvaluator.evaluate(state.addressB[i]);
        assertThat(value).isEqualTo(state.poiExpectedValues[i]); /* comment for better performance */
        bh.consume(value);
    }
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:9,代码来源:CalcEngine_vs_POI_Formula_Set_Test.java


示例7: evaluate

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
/**
 * This function does nothing, since it should never be evaluated.
 * DEFINE function is a spreadsheet metadata and it cannot have a value.
 */
@Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
    log.debug("In evaluate() of DEFINE function. Args = {}", Arrays.toString(args));
    
    return new StringEval(DefineFunction.class.getAnnotation(CustomFunctionMeta.class).value());
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:11,代码来源:DefineFunction.java


示例8: fetchValuesWithFullScan

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
protected List<ValueEval> fetchValuesWithFullScan(IDataSet set, Map<Integer, Object> where, int columnIndex) {

        List<ValueEval> found = new ArrayList<>();
        
        for (IDsRow row : set) {
            boolean allFieldsMatch = true;
            int allFieldsPresent = where.size();
            
            for (Entry<Integer, Object> whereColumn : where.entrySet()) {
                IDsCell cell = row.getCell(whereColumn.getKey());
                
                if (cell != null) {
                    allFieldsPresent--;
                    Object extValue = coerceValueTo(whereColumn.getValue());
                    /* Such a strange conversion because of Number types - everything is Double in POI */
                    Object intValue = coerceValueTo(valueToValueEval(cell.getValue().get()));

                    if (!intValue.equals(extValue)) { allFieldsMatch = false; break; }
                }
            }
            
            if (allFieldsPresent == 0 && allFieldsMatch) {
                found.add(valueToValueEval(row.getCell(columnIndex).getValue().get()));
                break; // collecting only the first matching record according to product owner requirements
            }
        }

        return found;
    }
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:30,代码来源:DsLookupFunction.java


示例9: evaluate

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {		
	try {
		final ValueEval p = OperandResolver.getSingleValue(args[0], ec.getRowIndex(), ec.getColumnIndex()) ;
		final ValueEval mu = OperandResolver.getSingleValue(args[1], ec.getRowIndex(), ec.getColumnIndex()) ;
		final ValueEval sigma = OperandResolver.getSingleValue(args[2], ec.getRowIndex(), ec.getColumnIndex()) ;			
		return new NumberEval(this.compute(OperandResolver.coerceValueToDouble(p), OperandResolver.coerceValueToDouble(mu), OperandResolver.coerceValueToDouble(sigma)));
	} catch (EvaluationException e) {
		return e.getErrorEval();
	}			 		
}
 
开发者ID:michael-simons,项目名称:enerko-reports2,代码行数:11,代码来源:NormInv.java


示例10: evaluate

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
public final ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) {
	switch (args.length) {
		case 1:
			return evaluate(srcRowIndex, srcColumnIndex, args[0], null);
		case 2:
			return evaluate(srcRowIndex, srcColumnIndex, args[0], args[1]);
	}
	return ErrorEval.VALUE_INVALID;
}
 
开发者ID:shunjikonishi,项目名称:excel2canvas,代码行数:10,代码来源:Weekday.java


示例11: evaluate

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
@Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
    return super.evaluate(args, ec);
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:5,代码来源:ModelexecFunction.java


示例12: putVertexToStack

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
@Override
public void putVertexToStack(ValueEval value, IExecutionGraphVertex vertex) {
    if (value == null) { throw new CalculationEngineException("ValueEval to assosiate vertex with cannot be null."); }
    this.valueToVertex.putIfAbsent(value, new LinkedList<>());
    this.valueToVertex.get(value).push((ExecutionGraphVertex) vertex);
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:7,代码来源:PoiExecutionGraphBuilder.java


示例13: getVertexFromStack

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
@Override
public ExecutionGraphVertex getVertexFromStack(ValueEval value) {
    if (value == null) { throw new CalculationEngineException("ValueEval to assosiate vertex with cannot be null."); }
    /* the value is taken from the Deque while it is taken from the stack in poi WorkbookEvaluator class */
    return this.valueToVertex.get(value).pop();
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:7,代码来源:PoiExecutionGraphBuilder.java


示例14: dereference

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
protected static <T extends ValueEval> T dereference(Class<T> target, ValueEval value) {
    if (!(value instanceof RefEval)) { return null; }
    
    ValueEval candidateValue = ((RefEval) value).getInnerValueEval(0);
    return candidateValue.getClass() == target ? (T) candidateValue : null;
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:7,代码来源:ValidateFunction.java


示例15: toArrayEval

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
private static TwoDEval toArrayEval(List<ValueEval> outputValues) {
    ArrayEval ae = new ArrayEval();
    ae.setValues(outputValues);
    return ae;
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:6,代码来源:FuncexecFunction.java


示例16: resolveValueEval

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
/** Converts {@link ValueEval} to {@link ICellValue}. */
public static ICellValue resolveValueEval(ValueEval valueEval) {
    return resolveCellValue(coerceValueEvalToCellValue(valueEval));
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:5,代码来源:ConverterUtils.java


示例17: evaluate

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
@Override
public ValueEval evaluate(int arg0, int arg1, ValueEval arg2,
		ValueEval arg3)
{
	// TODO Auto-generated method stub
	
	
	System.out.println("************* " + arg3);
	
	
	return null;
}
 
开发者ID:rodrigoEclipsa,项目名称:excelToApp,代码行数:13,代码来源:Pearson.java


示例18: fetchValuesWithOptimisations

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
protected List<ValueEval> fetchValuesWithOptimisations(DsLookupParameters parameters, OperationEvaluationContext ec) {
    DataSetOptimisationsCache caches = (DataSetOptimisationsCache) ec.getCustomEvaluationContext().get(DataSetOptimisationsCache.class);
    if (caches == null) { caches = this.external.getDataSetOptimisationsCache(); }
    
    Cache<DsLookupParameters, List> cache = caches.getDataSetToDsLookupParameters();
   
    if (cache.containsKey(parameters)) { return cache.get(parameters); }

    return null;
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:11,代码来源:DsLookupFunction.java


示例19: updateOptimisationsCache

import org.apache.poi.ss.formula.eval.ValueEval; //导入依赖的package包/类
protected void updateOptimisationsCache(DsLookupParameters parameters, IDataSet dataSet, List<ValueEval> fetchedValues, OperationEvaluationContext ec) {
    if (fetchedValues == null || parameters == null) { return; }
    
    DataSetOptimisationsCache caches = (DataSetOptimisationsCache) ec.getCustomEvaluationContext().get(DataSetOptimisationsCache.class);
    if (caches == null) { caches = this.external.getDataSetOptimisationsCache(); }
    
    Cache<DsLookupParameters, List> cache = caches.getDataSetToDsLookupParameters();
    
    cache.put(parameters, fetchedValues);
}
 
开发者ID:DataArt,项目名称:CalculationEngine,代码行数:11,代码来源:DsLookupFunction.java



注:本文中的org.apache.poi.ss.formula.eval.ValueEval类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PatientMobility类代码示例发布时间:2022-05-15
下一篇:
Java SampleXmlUtil类代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap