Interface MutableGraph<N>
- Type Parameters:
- N- Node parameter type
- All Superinterfaces:
- Graph<N>,- PredecessorsFunction<N>,- SuccessorsFunction<N>
- 
Method SummaryModifier and TypeMethodDescriptionbooleanAddsnodeif it is not already present.booleanputEdge(EndpointPair<N> endpoints) Adds an edge connectingendpoints(in the order, if any, specified byendpoints) if one is not already present.booleanAdds an edge connectingnodeUtonodeVif one is not already present.booleanremoveEdge(EndpointPair<N> endpoints) Removes the edge connectingendpoints, if it is present.booleanremoveEdge(N nodeU, N nodeV) Removes the edge connectingnodeUtonodeV, 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.GraphadjacentNodes, allowsSelfLoops, degree, edges, equals, hasEdgeConnecting, hasEdgeConnecting, hashCode, incidentEdgeOrder, incidentEdges, inDegree, isDirected, nodeOrder, nodes, outDegree, 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 graph was modified as a result of this call
 
- 
putEdgeAdds an edge connectingnodeUtonodeVif one is not already present.If the graph is directed, the resultant edge will be directed; otherwise, it will be undirected. If nodeUandnodeVare not already present in this graph, this method will silentlyaddnodeUandnodeVto the graph.- Returns:
- trueif the graph was modified as a result of this call
- Throws:
- IllegalArgumentException- if the introduction of the edge would violate- Graph.allowsSelfLoops()
 
- 
putEdgeAdds an edge connectingendpoints(in the order, if any, specified byendpoints) if one is not already present.If this graph is directed, endpointsmust be ordered and the added edge will be directed; if it is undirected, the added edge will be undirected.If this graph is directed, endpointsmust be ordered.If either or both endpoints are not already present in this graph, this method will silently addeach missing endpoint to the graph.- Returns:
- trueif the graph was modified as a result of this call
- Throws:
- IllegalArgumentException- if the introduction of the edge would violate- Graph.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 graph was modified as a result of this call
 
- 
removeEdgeRemoves the edge connectingnodeUtonodeV, if it is present.- Returns:
- trueif the graph was modified as a result of this call
 
- 
removeEdgeRemoves the edge connectingendpoints, if it is present.If this graph is directed, endpointsmust be ordered.- Returns:
- trueif the graph was modified as a result of this call
- Throws:
- IllegalArgumentException- if the endpoints are unordered and the graph is directed
- Since:
- 27.1
 
 
-