/** * @return the name of the replacement node, if one is given in the node name mapping, or the * old node name */ private String getReplacementNodeName(GraphElement oldNode) { String oldName = oldNode instanceof Node ? ((Node) oldNode).getFullyQualifiedName() : oldNode.getName(); if (nodeNameMapping != null && nodeNameMapping.containsKey(oldName)) { return (String) nodeNameMapping.get(oldName); } // return new node name = old node name as default return oldName; }
/** * @return the name of the replacement node, if one is given in the node name mapping, or the * old node name */ private String getReplacementNodeName(GraphElement oldNode) { String oldName = oldNode instanceof Node ? ((Node) oldNode).getFullyQualifiedName() : oldNode.getName(); if (nodeNameMapping != null && nodeNameMapping.containsKey(oldName)) { return (String) nodeNameMapping.get(oldName); } // return new node name = old node name as default return oldName; }
result = name.equals(other.getName());
public boolean equals(Object o) { if (o == this) return true; if (!getClass().isInstance(o)) return false; GraphElement other = (GraphElement) o; if (id != 0 && id == other.getId()) return true; GraphElement parent = getParent(); GraphElement otherParent = other.getParent(); boolean result; if (name != null && parent != null) { result = name.equals(other.getName()); } else if (parent instanceof NodeCollection && otherParent instanceof NodeCollection) { NodeCollection nodeCollection = (NodeCollection) parent; int index = nodeCollection.getNodes().indexOf(this); assert index != -1 : nodeCollection.getNodes(); NodeCollection otherNodeCollection = (NodeCollection) otherParent; int otherIndex = otherNodeCollection.getNodes().indexOf(other); result = index == otherIndex; } else { return false; } return result && parent.equals(otherParent); }