@SuppressWarnings("unchecked") public <T extends Node> T addNode(String id) { AbstractNode node = getNode(id); if (node != null) { if (strictChecking) throw new IdAlreadyInUseException("id \"" + id + "\" already in use. Cannot create a node."); return (T) node; } node = nodeFactory.newInstance(id, this); addNodeCallback(node); listeners.sendNodeAdded(id); return (T) node; }
@SuppressWarnings("unchecked") public <T extends Node> T addNode(String id) { AbstractNode node = getNode(id); if (node != null) { if (strictChecking) throw new IdAlreadyInUseException("id \"" + id + "\" already in use. Cannot create a node."); return (T) node; } node = nodeFactory.newInstance(id, this); addNodeCallback(node); listeners.sendNodeAdded(id); return (T) node; }
if (edge != null) { if (strictChecking) throw new IdAlreadyInUseException("id \"" + edgeId + "\" already in use. Cannot create an edge."); if ((edge.getSourceNode() == src && edge.getTargetNode() == dst)
if (edge != null) { if (strictChecking) throw new IdAlreadyInUseException("id \"" + edgeId + "\" already in use. Cannot create an edge."); if ((edge.getSourceNode() == src && edge.getTargetNode() == dst)