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

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


      new StringEval("Ed"),
      new StringEval("Greg"),
      new StringEval("Ian"),
    };

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

    // Note String comparisons are case insensitive
    confirmInt(3, invokeMatch(new StringEval("Ed"), ae, MATCH_LARGEST_LTE));
    confirmInt(3, invokeMatch(new StringEval("eD"), ae, MATCH_LARGEST_LTE));
    confirmInt(3, invokeMatch(new StringEval("Ed"), ae, MATCH_EXACT));
View Full Code Here


                new StringEval("Ed"),
                new StringEval("Greg"),
                new StringEval("Ian"),
        };

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

        // Note String comparisons are case insensitive
        confirmInt(3, invokeMatch(new StringEval("e*"), ae, MATCH_EXACT));
        confirmInt(3, invokeMatch(new StringEval("*d"), ae, MATCH_EXACT));

View Full Code Here

        ValueEval[] values = {
                new StringEval("what?"),
                new StringEval("all*")
        };

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

        confirmInt(1, invokeMatch(new StringEval("what~?"), ae, MATCH_EXACT));
        confirmInt(2, invokeMatch(new StringEval("all~*"), ae, MATCH_EXACT));
    }
View Full Code Here

        BoolEval.FALSE,
        BoolEval.TRUE,
        BoolEval.TRUE,
    };

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

    // Note String comparisons are case insensitive
    confirmInt(2, invokeMatch(BoolEval.FALSE, ae, MATCH_LARGEST_LTE));
    confirmInt(1, invokeMatch(BoolEval.FALSE, ae, MATCH_EXACT));
    confirmInt(4, invokeMatch(BoolEval.TRUE, ae, MATCH_LARGEST_LTE));
View Full Code Here

        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

        testErrors();
        testErrors2();
    }

    private static ValueEval invokePercentile(ValueEval[] args, ValueEval percentile) {
        AreaEval aeA = EvalFactory.createAreaEval("A1:A" + args.length, args);
        ValueEval[] args2 = { aeA, percentile };
        return AggregateFunction.PERCENTILE.evaluate(args2, -1, -1);
    }
View Full Code Here

    if (eval == null) {
      throw new RuntimeException("parameter may not be null");
    }
    if (eval instanceof AreaEval) {
      AreaEval ae = (AreaEval) eval;
      // an area ref can work as a scalar value if it is 1x1
      if(!ae.isColumn() || !ae.isRow()) {
        throw new EvaluationException(ErrorEval.VALUE_INVALID);
      }
      eval = ae.getRelativeValue(0, 0);
    }

    return getProductTerm(eval, true);
  }
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

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.