Examples of eval()


Examples of org.jruby.RubyRuntimeAdapter.eval()

        config.processArguments(new String[]{"--debug"});
        Ruby rt = JavaEmbedUtils.initialize(Collections.emptyList(), config);
        NativeTracer tracer = new NativeTracer();
        rt.addEventHook(tracer);
        RubyRuntimeAdapter evaler = JavaEmbedUtils.newRuntimeAdapter();
        evaler.eval(rt, "sleep 0.01\nsleep 0.01\nsleep 0.01");
        assertEquals("expected tracing", Arrays.asList(1,1,1,2,2,2,3,3,3), tracer.lines);
    }

    private final static class NativeTracer extends EventHook {
       
View Full Code Here

Examples of org.milyn.expression.ExpressionEvaluator.eval()

        if (evaluator == null) {
            throw new SmooksException("Unknown rule name '" + ruleName + "' on MVEL RuleProvider '" + name + "'.");
        }

        try {
            return new MVELRuleEvalResult(evaluator.eval(context.getBeanContext().getBeanMap()), ruleName, name, selectedData.toString());
        } catch(Throwable t) {
            return new MVELRuleEvalResult(t, ruleName, name, selectedData.toString());
        }
    }
View Full Code Here

Examples of org.milyn.expression.MVELExpressionEvaluator.eval()

    }

    private boolean evalReportCondition(ElementVisitEvent visitEvent, String condition) {
        MVELExpressionEvaluator conditionEval = new MVELExpressionEvaluator();
        conditionEval.setExpression(condition);
        return conditionEval.eval(visitEvent.getResourceConfig());
    }

    /**
     * Get the {@link ExecutionEvent} list.
     * @return The {@link ExecutionEvent} list.
View Full Code Here

Examples of org.nutz.el.El.eval()

        try {
          El el2pre = new El(elstr);
          context.set("num", 0);
          context.set("z", z);
          for (int i = 0; i < max; i++)
            context.set("num", el2pre.eval(context.set("i", i)));
          System.out.println("Num: " + context.getInt("num"));
        }
        catch (Exception e) {
          throw Lang.wrapThrow(e);
        }
View Full Code Here

Examples of org.olat.course.nodes.CourseNode.eval()

      // course
      ICourse course = CourseFactory.loadCourse(repositoryEntry.getOlatResource());
      CourseNode rootNode = course.getRunStructure().getRootNode();
      UserCourseEnvironmentImpl uce = new UserCourseEnvironmentImpl(ureq.getUserSession().getIdentityEnvironment(), course
          .getCourseEnvironment());
      NodeEvaluation nodeEval = rootNode.eval(uce.getConditionInterpreter(), new TreeEvaluation());
      boolean mayAccessWholeTreeUp = NavigationHandler.mayAccessWholeTreeUp(nodeEval);
      if (!mayAccessWholeTreeUp || !nodeEval.isVisible()) {
        String explan = rootNode.getNoAccessExplanation();
        String sExplan = (explan == null ? translate("launch.noaccess") : Formatter.formatLatexFormulas(explan));
        main.contextPut("disabledlaunchreason", sExplan);
View Full Code Here

Examples of org.olat.ims.qti.container.ItemContext.eval()

    if (!ict.isUnderMaxAttempts()) {
      // current item must be below maxattempts
      return QTIConstants.ERROR_SUBMITTEDITEM_TOOMANYATTEMPTS;
    }
    int subres = ict.addItemInput(itemInput);
    ict.eval(); // to have an up-to-date score
    return subres;
  }
 
  public int submitMultipleItems(ItemsInput curitsinp) {
    // = submit a whole section at once
View Full Code Here

Examples of org.olat.ims.qti.container.SectionContext.eval()

      // display a error msg above the next section or assessment-finished-text
      getInfo().setError(st);
      getInfo().setRenderItems(true);
    } else { // section was successfully submitted
      sc.sectionWasSubmitted(); // increase times answered of section
      sc.eval(); // calculate any section feedback
      if (sc.isFeedbackavailable()) {
        Output outp = sc.getOutput();
        getInfo().setCurrentOutput(outp);
        getInfo().setFeedback(true);
      }
View Full Code Here

Examples of org.olat.ims.qti.process.elements.ScoreBooleanEvaluable.eval()

    boolean ev = false;
    for (int i = 0; i < size; i++) {
      Element child = (Element)elems.get(i);
      String name = child.getName();
      ScoreBooleanEvaluable bev = QTIHelper.getSectionBooleanEvaluableInstance(name);
      boolean res = bev.eval(child, score);
      ev = ev || res;
      if (ev) return true;
    }
    return false;
  }
View Full Code Here

Examples of org.omegahat.Environment.Parser.Parse.ConstructorExpression.eval()

assignArguments(args, argumentKeys);

ConstructorExpression c = new ConstructorExpression(className, args, true);
Object val = null;

val = c.eval(evaluator());


/*
Don't do this now. Leave the C-code comeback and make it a reference
if _it_ determines the value can not be converted.
View Full Code Here

Examples of org.omegahat.Environment.Parser.Parse.DynamicFieldAccess.eval()

     ans = call.eval(evaluator());
   } catch(NoSuchMethodException ex) {

       try {
         DynamicFieldAccess fieldCall =  new DynamicFieldAccess(call.qualifier(), call.methodName());
         ans = fieldCall.eval(evaluator());
       } catch (Exception e) {
         throw ex;
       }
   }
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.