if(op1name.startsWith(AbstractRuleOperator.internal_name)) {
continue;
}
if(op0name.equals(op1name) && !op0.getClassType().equals(op1.getClassType())) {
throw new ModificationException("ERROR: Two operators on both sides have the same name but not the same class type!", op1);
}
else if(op0name.equals(op1name) && op0.getClassType().equals(op1.getClassType())) {
equalOps.add(op0name);
}
}
}
jumpOps_right.removeAll(jumpOps_left);
if(jumpOps_right.size() > 0) {
throw new ModificationException("ERROR: It is not allowed to add JumpOverOperators on the right side which are not present on the left side!", null);
}
for(final GraphWrapper gw : visualGraph0.getRootList(false)) {
this.validateCycles((Operator) gw.getElement(), new LinkedHashSet<Operator>(), false);
}
for(final GraphWrapper gw : visualGraph1.getRootList(false)) {
this.validateCycles((Operator) gw.getElement(), new LinkedHashSet<Operator>(), false);
}
final AbstractRuleOperator startNode = this.getStartNode();
if(startNode == null) {
return new Triple<Boolean, HashMap<String, VariableContainer>, HashMap<String, VariableContainer>>(true, null, null);
}
this.analyze_manage_node(variableList_left, startNode, 0, new HashSet<AbstractRuleOperator>(), new HashMap<Operator, HashSet<Operator>>());
if(variableList_left.get(startNode.getName()).getDimension() > 0) {
throw new ModificationException("ERROR: The dimension of the start node must be 0!", null);
}
boolean changed = true;
final LinkedList<HashSet<ConnectionContainer>> connections = this.getConnections();
final HashSet<ConnectionContainer> rightConnections = connections.get(1);
if(visualGraph1.getRootList(false).size() > 0) {
this.analyze_manage_node(variableList_right, (AbstractRuleOperator) visualGraph1.getRootList(false).get(0).getElement(), 0, new HashSet<AbstractRuleOperator>(), new HashMap<Operator, HashSet<Operator>>());
}
for(final ConnectionContainer conn : rightConnections) {
final String parentName = this.getJumpOverName(conn.getParent(), false);
final String childName = this.getJumpOverName(conn.getChild(), true);
if(variableList_left.containsKey(childName)) {
if(!variableList_left.containsKey(parentName) && conn.getMode() != ModeEnum.ALL_PRECEDING) {
variableList_right.get(parentName).setCountProvider(conn.getChild());
}
variableList_right.get(childName).setCountProvider(conn.getChild());
}
if(variableList_left.containsKey(parentName)) {
if(!variableList_left.containsKey(childName) && conn.getMode() != ModeEnum.ALL_SUCCEEDING) {
variableList_right.get(childName).setCountProvider(conn.getParent());
}
variableList_right.get(parentName).setCountProvider(conn.getParent());
}
}
while(changed) {
changed = false;
for(final ConnectionContainer conn : rightConnections) {
final String parentName = this.getJumpOverName(conn.getParent(), false);
final String childName = this.getJumpOverName(conn.getChild(), true);
if(variableList_right.get(parentName).getCountProvider() == null && variableList_right.get(childName).getCountProvider() != null) {
variableList_right.get(parentName).setCountProvider(variableList_right.get(childName).getCountProvider());
changed = true;
}
else if(variableList_right.get(childName).getCountProvider() == null && variableList_right.get(parentName).getCountProvider() != null) {
variableList_right.get(childName).setCountProvider(variableList_right.get(parentName).getCountProvider());
changed = true;
}
}
}
for(final VariableContainer vc : variableList_right.values()) {
if(vc.getCountProvider() == null) {
if(!variableList_left.containsKey(vc.getOpName())) {
throw new ModificationException("ERROR: Can't determine dimension size for operator " + vc.getOpName() + "!", null);
}
}
}