Examples of Operator


Examples of org.formulacompiler.compiler.Operator

        _stringBuilder.append( '"' );
      }

    }
    else if (_expr instanceof ExpressionNodeForOperator) {
      final Operator operator = ((ExpressionNodeForOperator) _expr).getOperator();
      final List<ExpressionNode> arguments = _expr.arguments();
      final int argCount = arguments.size();
      final boolean parenthesesNeeded = _context != null &&
          !(operator.equals( _context ) && COMMUTATIVE_OPERATORS.contains( operator ));
      switch (argCount) {
        case 0:
          _stringBuilder.append( operator.getSymbol() );
          break;
        case 1:
          if (parenthesesNeeded) _stringBuilder.append( '(' );
          final boolean isPrefix = operator.isPrefix();
          if (isPrefix) _stringBuilder.append( operator.getSymbol() );
          append( _stringBuilder, arguments.get( 0 ), _baseCell, operator );
          if (!isPrefix) _stringBuilder.append( operator.getSymbol() );
          if (parenthesesNeeded) _stringBuilder.append( ')' );
          break;
        default:
          if (parenthesesNeeded) _stringBuilder.append( '(' );
          appendArguments( _stringBuilder, arguments, operator.getSymbol(), _baseCell, operator );
          if (parenthesesNeeded) _stringBuilder.append( ')' );
          break;
      }
    }
    else if (_expr instanceof ExpressionNodeForFunction) {
View Full Code Here

Examples of org.gephi.filters.spi.Operator

                input = new Graph[]{graphModel.getGraph(newView)};    //duplicate root
            }
            //PROCESS
            if (q instanceof OperatorQueryImpl && !((OperatorQueryImpl) q).isSimple()) {
                OperatorQueryImpl operatorQuery = (OperatorQueryImpl) q;
                Operator op = (Operator) operatorQuery.getFilter();
                q.setResult(op.filter(input));
            } else if (q instanceof OperatorQueryImpl && ((OperatorQueryImpl) q).isSimple()) {
                OperatorQueryImpl operatorQuery = (OperatorQueryImpl) q;
                Operator op = (Operator) operatorQuery.getFilter();
                Filter[] filters = new Filter[operatorQuery.getChildrenCount()];
                for (int k = 0; k < filters.length; k++) {
                    filters[k] = operatorQuery.getChildAt(k).getFilter();
                }
                GraphView newView = graphModel.newView();
                views.add(newView);
                q.setResult(op.filter(graphModel.getGraph(newView), filters));
            } else {
                FilterQueryImpl filterQuery = (FilterQueryImpl) q;
                Filter filter = filterQuery.getFilter();
                if (filter instanceof NodeFilter && filter instanceof EdgeFilter) {
                    processNodeFilter((NodeFilter) filter, input[0]);
View Full Code Here

Examples of org.hornetq.core.filter.impl.Operator

   // Attributes ----------------------------------------------------

   // Static --------------------------------------------------------
   private static void assertSuccess(final int op, final Object arg1, final Object expectedResult) throws Exception
   {
      OperatorTest.assertOperationSuccess(new Operator(op, arg1), expectedResult);
   }
View Full Code Here

Examples of org.jboss.dna.graph.query.model.Operator

        if (constraint instanceof Comparison) {
            Comparison comparison = (Comparison)constraint;

            // Create the correct dynamic operation ...
            DynamicOperation dynamicOperation = createDynamicOperation(types, schemata, columns, comparison.getOperand1());
            Operator operator = comparison.getOperator();
            StaticOperand staticOperand = comparison.getOperand2();
            return createChecker(types, schemata, columns, dynamicOperation, operator, staticOperand);
        }
        if (constraint instanceof SetCriteria) {
            SetCriteria setCriteria = (SetCriteria)constraint;
            DynamicOperation dynamicOperation = createDynamicOperation(types, schemata, columns, setCriteria.getLeftOperand());
            Operator operator = Operator.EQUAL_TO;
            final List<ConstraintChecker> checkers = new LinkedList<ConstraintChecker>();
            for (StaticOperand setValue : setCriteria.getRightOperands()) {
                ConstraintChecker rightChecker = createChecker(types, schemata, columns, dynamicOperation, operator, setValue);
                assert rightChecker != null;
                checkers.add(rightChecker);
View Full Code Here

Examples of org.jboss.jms.selector.Operator

   public void testSimpleUnary() throws Exception
   {
      // Neg Long
      log.trace("parse(-12345 = -1 * 12345)");
      Operator result = (Operator) parser.parse("-12345 = -1 * 12345", identifierMap);
      log.trace("result -> "+result);
      Boolean b = (Boolean) result.apply();
      assertTrue("is true", b.booleanValue());

      // Neg Double
      log.trace("parse(-1 * 12345.67 = -12345.67)");
      result = (Operator) parser.parse("-1 * 12345.67 = -12345.67", identifierMap);
      log.trace("result -> "+result);
      b = (Boolean) result.apply();
      assertTrue("is true", b.booleanValue());

      log.trace("parse(-(1 * 12345.67) = -12345.67)");
      result = (Operator) parser.parse("-(1 * 12345.67) = -12345.67", identifierMap);
      log.trace("result -> "+result);
      b = (Boolean) result.apply();
      assertTrue("is true", b.booleanValue());
   }
View Full Code Here

Examples of org.jboss.jms.selector.Operator

   public void testINANDCombination()
   {
      try
      {
         log.trace("parse(Cateogry IN ('category1') AND Rating >= 2");
         Operator result = (Operator)parser.parse("Cateogry IN ('category1') AND Rating >= 2", identifierMap);
         ((Identifier) identifierMap.get("Cateogry")).setValue("category1");
         ((Identifier) identifierMap.get("Rating")).setValue(new Integer(3));
         log.trace("result -> "+result);
         Boolean bool = (Boolean) result.apply();
         assertTrue("is true", bool.booleanValue());
      } catch (Exception e)
      {
         log.trace("failed", e);
         fail(""+e);
View Full Code Here

Examples of org.jboss.jms.server.selector.Operator

   public void testSimpleUnary() throws Exception
   {
      // Neg Long
      log.trace("parse(-12345 = -1 * 12345)");
      Operator result = (Operator) parser.parse("-12345 = -1 * 12345", identifierMap);
      log.trace("result -> "+result);
      Boolean b = (Boolean) result.apply();
      assertTrue("is true", b.booleanValue());

      // Neg Double
      log.trace("parse(-1 * 12345.67 = -12345.67)");
      result = (Operator) parser.parse("-1 * 12345.67 = -12345.67", identifierMap);
      log.trace("result -> "+result);
      b = (Boolean) result.apply();
      assertTrue("is true", b.booleanValue());

      log.trace("parse(-(1 * 12345.67) = -12345.67)");
      result = (Operator) parser.parse("-(1 * 12345.67) = -12345.67", identifierMap);
      log.trace("result -> "+result);
      b = (Boolean) result.apply();
      assertTrue("is true", b.booleanValue());
   }
View Full Code Here

Examples of org.kie.api.runtime.rule.Operator

    }

    public long calculateDeclaredMask(List<String> settableProperties) {
        Long typeBit = 0L;
        if ( constraint instanceof EvaluatorConstraint && ( (EvaluatorConstraint) constraint ).isSelf() ) {
            Operator op = ((EvaluatorConstraint) constraint).getEvaluator().getOperator();
            if ( op == IsAEvaluatorDefinition.ISA || op == IsAEvaluatorDefinition.NOT_ISA ) {
                typeBit = Long.MIN_VALUE;
            }
        }
        if (settableProperties == null || !(constraint instanceof MvelConstraint)) {
View Full Code Here

Examples of org.modeshape.jcr.api.query.qom.Operator

        map.put(QueryObjectModelConstants.JCR_OPERATOR_NOT_EQUAL_TO, Operator.NOT_EQUAL_TO);
        OPERATORS_BY_JCR_NAME = Collections.unmodifiableMap(map);
    }

    static Operator operatorFromSymbol( String jcrConstantValue ) {
        Operator op = OPERATORS_BY_JCR_NAME.get(jcrConstantValue);
        if (op == null) op = Operator.forSymbol(jcrConstantValue);
        assert op != null;
        return op;
    }
View Full Code Here

Examples of org.molgenis.framework.db.QueryRule.Operator

      QueryRule rule = rules.get(i);
      if (mapper != null)
      {
        rule.setField(mapper.getTableFieldName(rule.getField()));

        Operator operator = rule.getOperator();
        if (operator == Operator.SORTASC || operator == Operator.SORTDESC)
        {
          rule.setField(mapper.getTableFieldName(rule.getValue().toString()));
        }
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.