@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; }