Examples of AreaEval


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

      return e.getErrorEval();
    }
  }
  public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1,
      ValueEval arg2) {
    AreaEval reference = convertFirstArg(arg0);

    boolean colArgWasPassed = true;
    try {
      int columnIx = resolveIndexArg(arg2, srcRowIndex, srcColumnIndex);
      int rowIx = resolveIndexArg(arg1, srcRowIndex, srcColumnIndex);
View Full Code Here

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

     * Note: no short-circuit boolean loop exit because any ErrorEvals will override the result
     */
    for (int i=0, iSize=args.length; i<iSize; i++) {
      ValueEval arg = args[i];
      if (arg instanceof AreaEval) {
        AreaEval ae = (AreaEval) arg;
        int height = ae.getHeight();
        int width = ae.getWidth();
        for (int rrIx=0; rrIx<height; rrIx++) {
          for (int rcIx=0; rcIx<width; rcIx++) {
            ValueEval ve = ae.getRelativeValue(rrIx, rcIx);
            Boolean tempVe = OperandResolver.coerceValueToBoolean(ve, true);
            if (tempVe != null) {
              result = partialEvaluate(result, tempVe.booleanValue());
              atleastOneNonBlank = true;
            }
View Full Code Here

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

  private static final String NULL = null;

  public void testCountBlank() {

    AreaEval range;
    ValueEval[] values;

    values = new ValueEval[] {
        new NumberEval(0),
        new StringEval("")// note - does not match blank
View Full Code Here

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

    confirmCountA(59, args);
  }

  public void testCountIf() {

    AreaEval range;
    ValueEval[] values;

    // when criteria is a boolean value
    values = new ValueEval[] {
        new NumberEval(0),
View Full Code Here

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

    }
    assertFalse(mp.matches(seA));
    assertTrue(mp.matches(seB));

    // general tests for not-equal (<>) operator
    AreaEval range;
    ValueEval[] values;

    values = new ValueEval[] {
        new StringEval("aa"),
        new StringEval("def"),
View Full Code Here

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

        new NumberEval(21),
        new NumberEval(25),
        new NumberEval(25),
        new NumberEval(25),
    };
    AreaEval arg0 = EvalFactory.createAreaEval("C1:C6", values);

    ValueEval criteriaArg = EvalFactory.createRefEval("A1", new NumberEval(25));
    ValueEval[] args=  { arg0, criteriaArg, };

    double actual = NumericFunctionInvoker.invoke(new Countif(), args);
View Full Code Here

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

    ValueEval v0 = new NumberEval(2.0);
    ValueEval v1 = new StringEval("abc");
    ValueEval v2 = ErrorEval.DIV_ZERO;

    AreaEval ev = EvalFactory.createAreaEval("A10:A12", new ValueEval[] { v0, v1, v2, });

    I_MatchPredicate mp;
    mp = Countif.createCriteriaPredicate(ev, 9, srcColIx);
    confirmPredicate(true, mp, srcColIx);
    confirmPredicate(false, mp, "abc");
View Full Code Here

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

    if (evaluationResult instanceof RefEval) {
      RefEval rv = (RefEval) evaluationResult;
      return rv.getInnerValueEval();
    }
    if (evaluationResult instanceof AreaEval) {
      AreaEval ae = (AreaEval) evaluationResult;
      if (ae.isRow()) {
        if(ae.isColumn()) {
          return ae.getRelativeValue(0, 0);
        }
        return ae.getValueAt(ae.getFirstRow(), srcColNum);
      }
      if (ae.isColumn()) {
        return ae.getValueAt(srcRowNum, ae.getFirstColumn());
      }
      return ErrorEval.VALUE_INVALID;
    }
    return evaluationResult;
  }
View Full Code Here

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

        switch (evals.length) {
        default:
            retval = ErrorEval.VALUE_INVALID;
        case 1:
            if (evals[0] instanceof AreaEval) {
                AreaEval ae = (AreaEval) evals[0];
                rnum = ae.getFirstRow();
            }
            else if (evals[0] instanceof RefEval) {
                RefEval re = (RefEval) evals[0];
                rnum = re.getRow();
            }
View Full Code Here

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

        switch (evals.length) {
        default:
            retval = ErrorEval.VALUE_INVALID;
        case 1:
            if (evals[0] instanceof AreaEval) {
                AreaEval ae = (AreaEval) evals[0];
                cnum = ae.getFirstColumn();
            }
            else if (evals[0] instanceof RefEval) {
                RefEval re = (RefEval) evals[0];
                cnum = re.getColumn();
            }
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.