Package org.apache.poi.ss.formula.eval

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


        new NumberEval(25),
        BoolEval.TRUE,
        new StringEval("Ed"),
    };

    AreaEval ae = EvalFactory.createAreaEval("A1:A13", values);

    assertEquals(ErrorEval.NA, invokeMatch(new StringEval("Aaron"), ae, MATCH_LARGEST_LTE));

    confirmInt(5, invokeMatch(BoolEval.FALSE, ae, MATCH_LARGEST_LTE));
    confirmInt(2, invokeMatch(BoolEval.FALSE, ae, MATCH_EXACT));
View Full Code Here


      new NumberEval(10),
      new NumberEval(10),
      new NumberEval(25),
    };

    AreaEval ae = EvalFactory.createAreaEval("A1:A5", values);

    AreaEval matchAE = EvalFactory.createAreaEval("C1:C1", new ValueEval[] { MATCH_LARGEST_LTE, });

    try {
      confirmInt(4, invokeMatch(new NumberEval(10), ae, matchAE));
    } catch (RuntimeException e) {
      if(e.getMessage().startsWith("Unexpected match_type type")) {
View Full Code Here

*/
public final class Sumif extends Var2or3ArgFunction {

  public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) {

    AreaEval aeRange;
    try {
      aeRange = convertRangeArg(arg0);
    } catch (EvaluationException e) {
      return e.getErrorEval();
    }
View Full Code Here

  }

  public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1,
      ValueEval arg2) {

    AreaEval aeRange;
    AreaEval aeSum;
    try {
      aeRange = convertRangeArg(arg0);
      aeSum = createSumRange(arg2, aeRange);
    } catch (EvaluationException e) {
      return e.getErrorEval();
View Full Code Here

    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

  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

    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

    }
    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

        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

    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

TOP

Related Classes of org.apache.poi.ss.formula.eval.AreaEval

Copyright © 2018 www.massapicom. 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.