/** * Warning: very inefficient! If this function is needed regularly it is * advised to use {@link TableGraph} instead. * @param node The node to remove. */ @Override public void removeNode(Point node) { // copy data first to avoid concurrent modification exceptions final List<Point> out = new ArrayList<>(); out.addAll(getOutgoingConnections(node)); for (final Point p : out) { removeConnection(node, p); } final List<Point> in = new ArrayList<>(); in.addAll(getIncomingConnections(node)); for (final Point p : in) { removeConnection(p, node); } deadEndNodes.remove(node); }
/** * Warning: very inefficient! If this function is needed regularly it is * advised to use {@link TableGraph} instead. * @param node The node to remove. */ @Override public void removeNode(Point node) { // copy data first to avoid concurrent modification exceptions final List<Point> out = new ArrayList<>(); out.addAll(getOutgoingConnections(node)); for (final Point p : out) { removeConnection(node, p); } final List<Point> in = new ArrayList<>(); in.addAll(getIncomingConnections(node)); for (final Point p : in) { removeConnection(p, node); } deadEndNodes.remove(node); }