@Override @CanIgnoreReturnValue public boolean removeEdge(E edge) { checkNotNull(edge, "edge"); N nodeU = edgeToReferenceNode.get(edge); if (nodeU == null) { return false; } NetworkConnections<N, E> connectionsU = nodeConnections.get(nodeU); N nodeV = connectionsU.adjacentNode(edge); NetworkConnections<N, E> connectionsV = nodeConnections.get(nodeV); connectionsU.removeOutEdge(edge); connectionsV.removeInEdge(edge, allowsSelfLoops() && nodeU.equals(nodeV)); edgeToReferenceNode.remove(edge); return true; }
if (!allowsSelfLoops()) { checkArgument(!isSelfLoop, SELF_LOOPS_NOT_ALLOWED, nodeU);
@Override @CanIgnoreReturnValue public boolean removeEdge(E edge) { checkNotNull(edge, "edge"); N nodeU = edgeToReferenceNode.get(edge); if (nodeU == null) { return false; } NetworkConnections<N, E> connectionsU = nodeConnections.get(nodeU); N nodeV = connectionsU.adjacentNode(edge); NetworkConnections<N, E> connectionsV = nodeConnections.get(nodeV); connectionsU.removeOutEdge(edge); connectionsV.removeInEdge(edge, allowsSelfLoops() && nodeU.equals(nodeV)); edgeToReferenceNode.remove(edge); return true; }
if (!allowsSelfLoops()) { checkArgument(!isSelfLoop, SELF_LOOPS_NOT_ALLOWED, nodeU);
@Override @CanIgnoreReturnValue public boolean removeEdge(E edge) { checkNotNull(edge, "edge"); N nodeU = edgeToReferenceNode.get(edge); if (nodeU == null) { return false; } NetworkConnections<N, E> connectionsU = nodeConnections.get(nodeU); N nodeV = connectionsU.adjacentNode(edge); NetworkConnections<N, E> connectionsV = nodeConnections.get(nodeV); connectionsU.removeOutEdge(edge); connectionsV.removeInEdge(edge, allowsSelfLoops() && nodeU.equals(nodeV)); edgeToReferenceNode.remove(edge); return true; }
if (!allowsSelfLoops()) { checkArgument(!isSelfLoop, SELF_LOOPS_NOT_ALLOWED, nodeU);
@Override @CanIgnoreReturnValue public boolean removeEdge(E edge) { checkNotNull(edge, "edge"); N nodeU = edgeToReferenceNode.get(edge); if (nodeU == null) { return false; } NetworkConnections<N, E> connectionsU = nodeConnections.get(nodeU); N nodeV = connectionsU.adjacentNode(edge); NetworkConnections<N, E> connectionsV = nodeConnections.get(nodeV); connectionsU.removeOutEdge(edge); connectionsV.removeInEdge(edge, allowsSelfLoops() && nodeU.equals(nodeV)); edgeToReferenceNode.remove(edge); return true; }
@Override @CanIgnoreReturnValue public boolean removeEdge(E edge) { checkNotNull(edge, "edge"); N nodeU = edgeToReferenceNode.get(edge); if (nodeU == null) { return false; } NetworkConnections<N, E> connectionsU = nodeConnections.get(nodeU); N nodeV = connectionsU.adjacentNode(edge); NetworkConnections<N, E> connectionsV = nodeConnections.get(nodeV); connectionsU.removeOutEdge(edge); connectionsV.removeInEdge(edge, allowsSelfLoops() && nodeU.equals(nodeV)); edgeToReferenceNode.remove(edge); return true; }
if (!allowsSelfLoops()) { checkArgument(!isSelfLoop, SELF_LOOPS_NOT_ALLOWED, nodeU);
if (!allowsSelfLoops()) { checkArgument(!isSelfLoop, SELF_LOOPS_NOT_ALLOWED, nodeU);