use of org.eclipse.xtext.resource.bug385636.Expression in project xtext-core by eclipse.
the class Expression_Not_LessImpl method basicSetLeft.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLeft(Expression newLeft, NotificationChain msgs) {
Expression oldLeft = left;
left = newLeft;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bug385636Package.EXPRESSION_NOT_LESS__LEFT, oldLeft, newLeft);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.xtext.resource.bug385636.Expression in project xtext-core by eclipse.
the class Expression_SmallerImpl method basicSetLeft.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLeft(Expression newLeft, NotificationChain msgs) {
Expression oldLeft = left;
left = newLeft;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bug385636Package.EXPRESSION_SMALLER__LEFT, oldLeft, newLeft);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.xtext.resource.bug385636.Expression in project drools by kiegroup.
the class DMNEvaluatorCompiler method compileList.
private DMNExpressionEvaluator compileList(DMNCompilerContext ctx, DMNModelImpl model, DMNBaseNode node, String listName, org.kie.dmn.model.v1_1.List expression) {
org.kie.dmn.model.v1_1.List listDef = expression;
DMNListEvaluator listEval = new DMNListEvaluator(node.getName(), node.getSource(), listDef);
for (Expression expr : listDef.getExpression()) {
listEval.addElement(compileExpression(ctx, model, node, listName, expr));
}
return listEval;
}
use of org.eclipse.xtext.resource.bug385636.Expression in project drools by kiegroup.
the class DMNListConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
List list = (List) parent;
for (Expression e : list.getExpression()) {
writeChildrenNode(writer, context, e, MarshallingUtils.defineExpressionNodeName(e));
}
}
use of org.eclipse.xtext.resource.bug385636.Expression in project newts by OpenNMS.
the class ResultDescriptor method expression.
public ResultDescriptor expression(String label, String expression) {
final JexlEngine je = new JexlEngine();
final Expression expr = je.createExpression(expression);
final String[] labels = getLabels().toArray(new String[0]);
CalculationFunction evaluate = new CalculationFunction() {
private static final long serialVersionUID = -3328049421398096252L;
@Override
public double apply(double... ds) {
JexlContext jc = new MapContext();
for (int i = 0; i < labels.length; i++) {
jc.set(labels[i], ds[i]);
}
return ((Number) expr.evaluate(jc)).doubleValue();
}
};
return calculate(label, evaluate, labels);
}
Aggregations