Examples of TwoDEval


Examples of org.apache.poi.ss.formula.TwoDEval

   * Collects values from a single argument
   */
  private void collectValues(ValueEval operand, DoubleList temp) throws EvaluationException {

    if (operand instanceof TwoDEval) {
      TwoDEval ae = (TwoDEval) operand;
      int width = ae.getWidth();
      int height = ae.getHeight();
      for (int rrIx=0; rrIx<height; rrIx++) {
        for (int rcIx=0; rcIx<width; rcIx++) {
          ValueEval ve = ae.getValue(rrIx, rcIx);
                    if(!isSubtotalCounted() && ae.isSubTotal(rrIx, rcIx)) continue;
                    collectValue(ve, true, temp);
        }
      }
      return;
    }
View Full Code Here

Examples of org.apache.poi.ss.formula.TwoDEval

      }
      if(firstArg instanceof RefEval) {
        return evaluateSingleProduct(args);
      }
      if (firstArg instanceof TwoDEval) {
        TwoDEval ae = (TwoDEval) firstArg;
        if(ae.isRow() && ae.isColumn()) {
          return evaluateSingleProduct(args);
        }
        return evaluateAreaSumProduct(args);
      }
    } catch (EvaluationException e) {
View Full Code Here

Examples of org.apache.poi.ss.formula.TwoDEval

      // one of the other args was not an AreaRef
      return ErrorEval.VALUE_INVALID;
    }


    TwoDEval firstArg = args[0];

    int height = firstArg.getHeight();
    int width = firstArg.getWidth(); // TODO - junit

    // first check dimensions
    if (!areasAllSameSize(args, height, width)) {
      // normally this results in #VALUE!,
      // but errors in individual cells take precedence
View Full Code Here

Examples of org.apache.poi.ss.formula.TwoDEval

    }
  }

  private static boolean areasAllSameSize(TwoDEval[] args, int height, int width) {
    for (int i = 0; i < args.length; i++) {
      TwoDEval areaEval = args[i];
      // check that height and width match
      if(areaEval.getHeight() != height) {
        return false;
      }
      if(areaEval.getWidth() != width) {
        return false;
      }
    }
    return true;
  }
View Full Code Here

Examples of org.apache.poi.ss.formula.TwoDEval

      ValueEval arg2, ValueEval arg3) {
    try {
      // Evaluation order:
      // arg0 lookup_value, arg1 table_array, arg3 range_lookup, find lookup value, arg2 row_index, fetch result
      ValueEval lookupValue = OperandResolver.getSingleValue(arg0, srcRowIndex, srcColumnIndex);
      TwoDEval tableArray = LookupUtils.resolveTableArrayArg(arg1);
      boolean isRangeLookup = LookupUtils.resolveRangeLookupArg(arg3, srcRowIndex, srcColumnIndex);
      int colIndex = LookupUtils.lookupIndexOfValue(lookupValue, LookupUtils.createRowVector(tableArray, 0), isRangeLookup);
      int rowIndex = LookupUtils.resolveRowOrColIndexArg(arg2, srcRowIndex, srcColumnIndex);
      ValueVector resultCol = createResultColumnVector(tableArray, rowIndex);
      return resultCol.getItem(colIndex);
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.