private String findModelClass(NodeElement node) { String name = modelClassMap.get(node); if (name != null) { return name; } if (node instanceof HasDataModelNode) { name = getModelClassName((HasDataModelNode) node); if (name == null) { name = UNDEFINED_CLASS; } modelClassMap.put(node, name); return name; } modelClassMap.put(node, UNDEFINED_CLASS); for (Connection c : node.getIncomings()) { NodeElement cnode = c.getOpposite(node); name = findModelClass(cnode); if (name != UNDEFINED_CLASS) { modelClassMap.put(node, name); return name; } } for (Connection c : node.getOutgoings()) { NodeElement cnode = c.getOpposite(node); name = findModelClass(cnode); if (name != UNDEFINED_CLASS) { modelClassMap.put(node, name); return name; } } return UNDEFINED_CLASS; }
public boolean complete(Map<Integer, GenNode> map) { for (NodeElement node : incomings) { if (!map.containsKey(node.getId())) { NodeElement parent = node.getParent(); if (parent == null) { return false; } if (!map.containsKey(parent.getId())) { return false; } } } return true; }
public GenNode(NodeElement node) { for (Connection c : node.getIncomings()) { NodeElement source = c.getSource(); incomings.add(source); } }