Examples of eval()


Examples of org.boris.expr.util.Condition.eval()

        if (cond == null)
            return ExprError.VALUE;
        Expr[] a = array.getArgs();
        int count = 0;
        for (int i = 0; i < a.length; i++) {
            if (cond.eval(a[i]))
                count++;
        }
        return new ExprDouble(count);
    }
}
View Full Code Here

Examples of org.boris.xlloop.script.LispFunctionHandler.eval()

    }

    public static IFunctionHandler createHandler() {
        ReflectFunctionHandler rfh = new ReflectFunctionHandler();
        LispFunctionHandler lfh = new LispFunctionHandler();
        lfh.eval(new File("functions"), true); // evaluate any lisp files
        ScriptRepository srep = new ScriptRepository(new File("functions"), "Script.");
        rfh.addMethods("Math.", Math.class);
        rfh.addMethods("Math.", Maths.class);
        rfh.addMethods("Reflect.", Reflect.class);
        rfh.addMethods("CSV.", CSV.class);
View Full Code Here

Examples of org.codehaus.preon.el.ast.ArithmeticNode.eval()

    @Test
    public void testJustArithmetic() {
        Node<Integer,?> a = new IntegerNode(12);
        Node<Integer,?> b = new IntegerNode(13);
        Node<Integer,?> expr = new ArithmeticNode(Operator.plus, a, b);
        assertEquals(25, expr.eval(null).intValue());
    }

    @SuppressWarnings("unchecked")
    @Test
    public void testJustRelation() {
View Full Code Here

Examples of org.codehaus.preon.el.ast.RelationalNode.eval()

    @Test
    public void testJustRelation() {
        Node<Integer,?> a = new IntegerNode(12);
        Node<Integer,?> b = new IntegerNode(13);
        Node<Boolean,?> expr = new RelationalNode(Relation.GT, a, b);
        assertEquals(false, expr.eval(null).booleanValue());
    }

    @SuppressWarnings("unchecked")
    @Test
    public void testCompound() {
View Full Code Here

Examples of org.criticalfailure.torchlight.core.application.script.ScriptEngine.eval()

//            engine.put("value", new Boolean(value));
//        }

        try {
            logger.debug("evaluating script");
            Object ret = engine.eval(prop.getValidatorBody());
            logger.trace("ret: " + ret);
           
            result.setValid(Boolean.parseBoolean(String.valueOf(ret)));
            logger.trace("isValid: " + result.isValid());
            result.setReason("");
View Full Code Here

Examples of org.exist.xquery.Expression.eval()

  }
 
  private void processAll() throws XPathException {
    for(int i = 0; i < orderSpecs.length; i++) {
      final Expression expr = orderSpecs[i].getSortExpression();
      final NodeSet result = expr.eval(null).toNodeSet();
      for(final Iterator j = result.iterator(); j.hasNext(); ) {
        final NodeProxy p = (NodeProxy)j.next();
        ContextItem context = p.getContext();
        //TODO : review to consider transverse context
        while(context != null) {
View Full Code Here

Examples of org.exist.xquery.FunctionCall.eval()

                 
                  final FunctionCall call = new FunctionCall(context, function);
                  if (args != null)
                    {call.setArguments(args);}
                  call.analyze(new AnalyzeContextInfo());
              call.eval(NodeSet.EMPTY_SET);
            }
            } catch(final XPathException e) {
              //XXX: log
              e.printStackTrace();
            } finally {
View Full Code Here

Examples of org.exist.xquery.PathExpr.eval()

                throw new EXistException(treeParser.getErrorMessage());
            }
            LOG.info("query: " + ExpressionDumper.dump(expr));
            final long start = System.currentTimeMillis();
            expr.analyze(new AnalyzeContextInfo());
            final Sequence seq= expr.eval(null, null);
           
            QueryResponseCollection[] collections = null;
            if (!seq.isEmpty() && Type.subTypeOf(seq.getItemType(), Type.NODE))
                {collections = collectQueryInfo(scanResults(seq));}
            session.addQueryResult(seq);
View Full Code Here

Examples of org.exist.xquery.RootNode.eval()

    public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
     
        if (contextSequence == null || contextSequence.isEmpty()) {
            // if the context sequence is empty, we create a default context
            final RootNode rootNode = new RootNode(context);
            contextSequence = rootNode.eval(null, null);
        }
        final Sequence[] args = getArguments(null, null);
       
        final Item item = args[0].itemAt(0);
        QNameValue qval;
View Full Code Here

Examples of org.exist.xquery.modules.ngram.query.EvaluatableExpression.eval()

            parsedQuery = parseQuery(query);
              else
            parsedQuery = new FixedString(this, query);

        LOG.debug("Parsed Query: " + parsedQuery);
        NodeSet result = parsedQuery.eval(index, docs, qnames, nodeSet, axis, this
                .getExpressionId());

        if (getLocalName().startsWith("starts-with"))
            result = NodeSets.getNodesMatchingAtStart(result, getExpressionId());
        else if (getLocalName().startsWith("ends-with"))
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.