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

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


    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

    /**
     * String criteria in COUNTIF are case insensitive;
     * for example, the string "apples" and the string "APPLES" will match the same cells.
     */
    public void testCaseInsensitiveStringComparison() {
        AreaEval range;
        ValueEval[] values;

        values = new ValueEval[] {
                new StringEval("no"),
                new StringEval("NO"),
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

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

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

    confirmInt(2, invokeMatch(new NumberEval(5), ae, MATCH_LARGEST_LTE));
    confirmInt(2, invokeMatch(new NumberEval(5), ae, MATCH_EXACT));
    confirmInt(4, invokeMatch(new NumberEval(10), ae, MATCH_LARGEST_LTE));
    confirmInt(3, invokeMatch(new NumberEval(10), ae, MATCH_EXACT));
View Full Code Here

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

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

    confirmInt(2, invokeMatch(new NumberEval(10), ae, MATCH_SMALLEST_GTE));
    confirmInt(2, invokeMatch(new NumberEval(10), ae, MATCH_EXACT));
    confirmInt(4, invokeMatch(new NumberEval(9), ae, MATCH_SMALLEST_GTE));
    confirmInt(1, invokeMatch(new NumberEval(20), ae, MATCH_SMALLEST_GTE));
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.