Interface MutableNetwork<N,E> 
- Type Parameters:
- N- Node parameter type
- E- Edge parameter type
- All Superinterfaces:
- Network<N,,- E> - PredecessorsFunction<N>,- SuccessorsFunction<N>
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddEdge(EndpointPair<N> endpoints, E edge) Addsedgeconnectingendpoints.booleanAddsedgeconnectingnodeUtonodeV.booleanAddsnodeif it is not already present.booleanremoveEdge(E edge) Removesedgefrom this network, if it is present.booleanremoveNode(N node) Removesnodeif it is present; all edges incident tonodewill also be removed.Methods inherited from interface com.google.common.graph.NetworkadjacentEdges, adjacentNodes, allowsParallelEdges, allowsSelfLoops, asGraph, degree, edgeConnectingOrNull, edgeConnectingOrNull, edgeOrder, edges, edgesConnecting, edgesConnecting, equals, hasEdgeConnecting, hasEdgeConnecting, hashCode, incidentEdges, incidentNodes, inDegree, inEdges, isDirected, nodeOrder, nodes, outDegree, outEdges, predecessors, successors
- 
Method Details- 
addNodeAddsnodeif it is not already present.Nodes must be unique, just as Mapkeys must be. They must also be non-null.- Returns:
- trueif the network was modified as a result of this call
 
- 
addEdgeAddsedgeconnectingnodeUtonodeV.If the graph is directed, edgewill be directed in this graph; otherwise, it will be undirected.edgemust be unique to this graph, just as aMapkey must be. It must also be non-null.If nodeUandnodeVare not already present in this graph, this method will silentlyaddnodeUandnodeVto the graph.If edgealready connectsnodeUtonodeV(in the specified order if this networkNetwork.isDirected(), else in any order), then this method will have no effect.- Returns:
- trueif the network was modified as a result of this call
- Throws:
- IllegalArgumentException- if- edgealready exists in the graph and does not connect- nodeUto- nodeV
- IllegalArgumentException- if the introduction of the edge would violate- Network.allowsParallelEdges()or- Network.allowsSelfLoops()
 
- 
addEdgeAddsedgeconnectingendpoints. In an undirected network,edgewill also connectnodeVtonodeU.If this graph is directed, edgewill be directed in this graph; if it is undirected,edgewill be undirected in this graph.If this graph is directed, endpointsmust be ordered.edgemust be unique to this graph, just as aMapkey must be. It must also be non-null.If either or both endpoints are not already present in this graph, this method will silently addeach missing endpoint to the graph.If edgealready connects an endpoint pair equal toendpoints, then this method will have no effect.- Returns:
- trueif the network was modified as a result of this call
- Throws:
- IllegalArgumentException- if- edgealready exists in the graph and connects some other endpoint pair that is not equal to- endpoints
- IllegalArgumentException- if the introduction of the edge would violate- Network.allowsParallelEdges()or- Network.allowsSelfLoops()
- IllegalArgumentException- if the endpoints are unordered and the graph is directed
- Since:
- 27.1
 
- 
removeNodeRemovesnodeif it is present; all edges incident tonodewill also be removed.- Returns:
- trueif the network was modified as a result of this call
 
- 
removeEdgeRemovesedgefrom this network, if it is present.- Returns:
- trueif the network was modified as a result of this call
 
 
-