Examples of AndExpression


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

    }   
    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.AndExpression

  private static final Logger log = Logger
      .getLogger(SimpleSqlExpressionTest.class);

  public void testSqlExpressionBuilder() throws ExpressionEvaluationException {
    // build expression
    Expression expr = new AndExpression().add(
        new ComparedEqualsExpression(new VariableExpression("name"),
            new ValueExpression("James Bond"), ComparatorFactory
                .getStringComparator(false, true, null))).add(
        new GreaterThanExpression(new VariableExpression("age"),
            new ValueExpression(new Long(25)))).add(
View Full Code Here

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

  }

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

    assertEquals("AndExpression must return true", Boolean.TRUE,
        new AndExpression().add(this.trueExpr).add(this.trueExpr)
            .evaluate(this.resolver));
    assertEquals("AndExpression must return false", Boolean.FALSE,
        new AndExpression().add(this.falseExpr).add(this.trueExpr)
            .evaluate(this.resolver));
    assertEquals("AndExpression must return false", Boolean.FALSE,
        new AndExpression().add(this.trueExpr).add(this.falseExpr)
            .evaluate(this.resolver));
    assertEquals("AndExpression must return false", Boolean.FALSE,
        new AndExpression().add(this.falseExpr).add(this.falseExpr)
            .evaluate(this.resolver));
  }
View Full Code Here

Examples of org.eclipse.ui.internal.expressions.AndExpression

  public final IHandlerActivation activateHandler(
      final IHandlerActivation childActivation) {
    final String commandId = childActivation.getCommandId();
    final IHandler handler = childActivation.getHandler();
    final Expression childExpression = childActivation.getExpression();
    final AndExpression expression;
    if (childExpression instanceof AndExpression) {
      expression = (AndExpression) childExpression;
    } else {
      expression = new AndExpression();
      if (childExpression != null) {
        expression.add(childExpression);
      }
    }
    if (defaultExpression != null) {
      expression.add(defaultExpression);
    }
    final int depth = childActivation.getDepth() + 1;
    final IHandlerActivation localActivation = new HandlerActivation(
        commandId, handler, expression, depth, this);
View Full Code Here

Examples of org.eclipse.ui.internal.expressions.AndExpression

          commandId, handler, expression, global);
      parentActivations.add(activation);
      return activation;
    }

    final AndExpression andExpression;
    if (expression instanceof AndExpression) {
      andExpression = (AndExpression) expression;
    } else {
      andExpression = new AndExpression();
      if (expression != null) {
        andExpression.add(expression);
      }
    }
    if (defaultExpression != null) {
      andExpression.add(defaultExpression);
    }
    final IHandlerActivation localActivation = new HandlerActivation(
        commandId, handler, andExpression,
        IHandlerActivation.ROOT_DEPTH, this);
    return doActivation(localActivation);
View Full Code Here

Examples of org.jamesii.model.carules.reader.antlr.parser.AndExpression

        integer++;
      }
      map.put(s, integer);
    }

    AndExpression a = new AndExpression(new BooleanCondition(true));
    List<String> states = Arrays.asList(allStates);
    for (Entry<String, Integer> e : map.entrySet()) {
      int i = states.indexOf(e.getKey());
      a.addCondition(new StateCondition(i, e.getValue(), e.getValue()));
    }

    return new CARule(new CurrentStateCondition(states.indexOf(currentState)),
        a, states.indexOf(targetState), 1d);
  }
View Full Code Here

Examples of org.odata4j.expression.AndExpression

    else if (filter instanceof LeExpression)
      applyFilter(q, (LeExpression) filter, FilterOperator.LESS_THAN_OR_EQUAL);

    // and filter
    else if (filter instanceof AndExpression) {
      AndExpression e = (AndExpression) filter;
      applyFilter(q, e.getLHS());
      applyFilter(q, e.getRHS());
    }

    else
      throw new NotImplementedException("Appengine only supports simple property expressions");
  }
View Full Code Here

Examples of ru.aristar.jnuget.query.AndExpression

     * @throws NugetFormatException ошибка вычисления HASH пакета
     */
    public TempNupkgFile getPackage(String id, Version version) throws IOException, URISyntaxException, NugetFormatException {
        IdEqIgnoreCase eqIgnoreCase = new IdEqIgnoreCase(id);
        VersionEq versionEq = new VersionEq(version);
        AndExpression andExpression = new AndExpression(eqIgnoreCase, versionEq);
        String filter = andExpression.toString();
        PackageFeed feed = getPackages(filter, null, 100, null, 0);
        if(feed.getEntries().isEmpty()) {
            return null;
        }
        URI uri = URI.create(feed.getEntries().get(0).getContent().getSrc());
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.