use of org.yakindu.base.types.Parameter in project statecharts by Yakindu.
the class OperationImpl method getId.
@Override
public String getId() {
String superId = super.getId();
if (superId == null)
return null;
StringBuilder builder = new StringBuilder(superId);
EList<Parameter> parameters = getParameters();
for (Parameter parameter : parameters) {
if (parameter.getType() == null || parameter.getType().getName() == null)
continue;
builder.append("_");
builder.append(parameter.getType().getName());
}
return builder.toString();
}
use of org.yakindu.base.types.Parameter in project statecharts by Yakindu.
the class ArgumentSorter method getOrderedExpressions.
public static EList<Expression> getOrderedExpressions(List<Argument> arguments, Operation operation) {
Expression[] result = new Expression[arguments.size()];
for (int index = 0; index < arguments.size(); index++) {
Argument argument = arguments.get(index);
List<INode> nodes = NodeModelUtils.findNodesForFeature(argument, ExpressionsPackage.Literals.ARGUMENT__PARAMETER);
if (nodes.isEmpty()) {
result[index] = argument.getValue();
} else {
// EcoreUtil.equals.)
for (Parameter param : operation.getParameters()) {
if (param.getName().equals(nodes.get(0).getText())) {
int parameterIndex = operation.getParameters().indexOf(param);
if (parameterIndex < result.length)
result[parameterIndex] = argument.getValue();
break;
}
}
}
}
EList<Expression> resultAsList = new BasicEList<Expression>();
for (int i = 0; i < result.length; i++) {
Expression expression = result[i];
if (expression != null)
resultAsList.add(expression);
}
return resultAsList;
}
Aggregations