Examples of OrExpression


Examples of org.araneaframework.backend.list.memorybased.expression.logical.OrExpression

  }
 
  public static class GreaterThanOrEquals extends SimpleProcedureFilter {
    private static final long serialVersionUID = 1L;
    protected Expression buildAction(Map filterInfo, Expression leftOperand, Expression rightOperand) {
      return new OrExpression().
      add(new GreaterThanExpression(leftOperand, rightOperand, getComparator())).   
      add(new ComparedEqualsExpression(leftOperand, rightOperand, getComparator()));
    }
View Full Code Here

Examples of org.araneaframework.backend.list.memorybased.expression.logical.OrExpression

  }
 
  public static class LowerThanOrEquals extends SimpleProcedureFilter {
    private static final long serialVersionUID = 1L;
    protected Expression buildAction(Map filterInfo, Expression leftOperand, Expression rightOperand) {
      return new OrExpression().
      add(new LowerThanExpression(leftOperand, rightOperand, getComparator())).   
      add(new ComparedEqualsExpression(leftOperand, rightOperand, getComparator()));
    }
View Full Code Here

Examples of org.araneaframework.backend.list.memorybased.expression.logical.OrExpression

    }   
    public GreaterThanOrEquals(Object value) {
      super(value);
    }
    protected Expression buildAction(Map filterInfo, Expression leftOperand, Expression rightOperand) {
      return new OrExpression().
      add(new GreaterThanExpression(leftOperand, rightOperand, getComparator())).   
      add(new ComparedEqualsExpression(leftOperand, rightOperand, getComparator()));
    }
View Full Code Here

Examples of org.araneaframework.backend.list.memorybased.expression.logical.OrExpression

    }   
    public LowerThanOrEquals(Object value) {
      super(value);
    }
    protected Expression buildAction(Map filterInfo, Expression leftOperand, Expression rightOperand) {
      return new OrExpression().
      add(new LowerThanExpression(leftOperand, rightOperand, getComparator())).   
      add(new ComparedEqualsExpression(leftOperand, rightOperand, getComparator()));
    }
View Full Code Here

Examples of org.araneaframework.backend.list.memorybased.expression.logical.OrExpression

    public ColumnRangeInValueRangeNonStrict() {
      super();
    }
    protected Expression buildAction(Expression startVar, Expression endVar, Expression startVal, Expression endVal) {
      AndExpression expr = new AndExpression();
      expr.add(new OrExpression().add(
          new GreaterThanExpression(startVar, startVal)).add(
              new EqualsExpression(startVar, startVal)));     
      expr.add(new OrExpression().add(
          new LowerThanExpression(endVar, endVal)).add(
              new EqualsExpression(endVar, endVal)));
      return expr;
    }
View Full Code Here

Examples of org.araneaframework.backend.list.memorybased.expression.logical.OrExpression

    public ValueRangeInColumnRangeNonStrict() {
      super();
    }
    protected Expression buildAction(Expression startVar, Expression endVar, Expression startVal, Expression endVal) {
      AndExpression expr = new AndExpression();
      expr.add(new OrExpression().add(
          new LowerThanExpression(startVar, startVal)).add(
              new EqualsExpression(startVar, startVal)));     
      expr.add(new OrExpression().add(
          new GreaterThanExpression(endVar, endVal)).add(
              new EqualsExpression(endVar, endVal)));
      return expr;
    }
View Full Code Here

Examples of org.araneaframework.backend.list.memorybased.expression.logical.OrExpression

    public RangesOverlapNonStrict() {
      super();
    }
    protected Expression buildAction(Expression startVar, Expression endVar, Expression startVal, Expression endVal) {
      AndExpression expr = new AndExpression();
      expr.add(new OrExpression().add(
          new LowerThanExpression(startVar, endVal)).add(
              new EqualsExpression(startVar, endVal)));     
      expr.add(new OrExpression().add(
          new GreaterThanExpression(endVar, startVal)).add(
              new EqualsExpression(endVar, startVal)));
      return expr;     
    }
View Full Code Here

Examples of org.araneaframework.backend.list.memorybased.expression.logical.OrExpression

  }

  public void testOrExpression() throws ExpressionEvaluationException {
    log.debug("Testing OrExpression");
    try {
      new OrExpression().evaluate(this.resolver);
      fail("OrExpression must throw an exception");
    } catch (ExpressionEvaluationException e) {
      // normal
    }
    try {
      new OrExpression().add(this.trueExpr).evaluate(this.resolver);
    } catch (ExpressionEvaluationException e) {
      fail("OrExpression must pass with one child");     
    }
    try {
      new OrExpression().add(this.notBoolExpr).add(this.trueExpr).add(
          this.trueExpr).evaluate(this.resolver);
      fail("OrExpression must throw an exception");
    } catch (Exception e) {
      // normal
    }

    assertEquals("OrExpression must return true", Boolean.TRUE,
        new OrExpression().add(this.trueExpr).add(this.trueExpr)
            .evaluate(this.resolver));
    assertEquals("OrExpression must return true", Boolean.TRUE,
        new OrExpression().add(this.falseExpr).add(this.trueExpr)
            .evaluate(this.resolver));
    assertEquals("OrExpression must return true", Boolean.TRUE,
        new OrExpression().add(this.trueExpr).add(this.falseExpr)
            .evaluate(this.resolver));
    assertEquals("OrExpression must return false", Boolean.FALSE,
        new OrExpression().add(this.falseExpr).add(this.falseExpr)
            .evaluate(this.resolver));
  }
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.