Examples of AreaEval


Examples of org.apache.poi.hssf.record.formula.eval.AreaEval

    }
    Eval firstArg = args[0];

    int result;
    if (firstArg instanceof AreaEval) {
      AreaEval ae = (AreaEval) firstArg;
      result = ae.getLastRow() - ae.getFirstRow() + 1;
    } else if (firstArg instanceof RefEval) {
      result = 1;
    } else { // anything else is not valid argument
      return ErrorEval.VALUE_INVALID;
    }
View Full Code Here

Examples of org.apache.poi.ss.formula.eval.AreaEval

    ValueEval[] values = new ValueEval[TEST_VALUES0.length];
    for (int i = 0; i < TEST_VALUES0.length; i++) {
      values[i] = new NumberEval(TEST_VALUES0[i]);
    }

    AreaEval arg1 = EvalFactory.createAreaEval("C1:D5", values);
    ValueEval args[] = { new NumberEval(function), arg1 };

    ValueEval result = new Subtotal().evaluate(args, 0, 0);

    assertEquals(NumberEval.class, result.getClass());
View Full Code Here

Examples of org.zkoss.poi.ss.formula.eval.AreaEval

    }
    String txt = constraint.getFormula1();
    Book book = sheet.getBook();
    final ValueEval ve = BookHelper.evaluateFormulaValueEval(book, book.getSheetIndex(sheet), txt, true);
    if (ve instanceof AreaEval) {
      final AreaEval ae = (AreaEval) ve;
      if (ae.isColumn() || ae.isRow()) {
        Worksheet worksheet = null;
        if (ae instanceof LazyAreaEval) {
          worksheet = book.getWorksheet(((LazyAreaEval) ve).getSheetName());
        } else {
          worksheet = sheet;
        }
       
        final int rows = ae.getHeight();
        final int cols = ae.getWidth();
        final int top = ae.getFirstRow();
        final int left = ae.getFirstColumn();
        String[] xlist = new String[rows*cols];
        for (int r = 0, j=0; r < rows; ++r) {
          int rowIndex = r + top;
          for (int c = 0; c < cols; ++c) {
            int colIndex = c + left;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.