N
- Node parameter typeE
- Edge parameter type@Beta public interface MutableNetwork<N,E> extends Network<N,E>
Network
which adds mutation methods. When mutation is not required,
users should prefer the Network
interface.Modifier and Type | Method and Description |
---|---|
boolean |
addEdge(N nodeU,
N nodeV,
E edge)
Adds
edge connecting nodeU to nodeV . |
boolean |
addNode(N node)
Adds
node if it is not already present. |
boolean |
removeEdge(E edge)
Removes
edge from this network, if it is present. |
boolean |
removeNode(N node)
Removes
node if it is present; all edges incident to node will also be removed. |
adjacentEdges, adjacentNodes, allowsParallelEdges, allowsSelfLoops, asGraph, degree, edgeConnecting, edgeConnectingOrNull, edgeOrder, edges, edgesConnecting, equals, hasEdgeConnecting, hashCode, incidentEdges, incidentNodes, inDegree, inEdges, isDirected, nodeOrder, nodes, outDegree, outEdges, predecessors, successors
@CanIgnoreReturnValue boolean addNode(N node)
node
if it is not already present.
Nodes must be unique, just as Map
keys must be. They must also be non-null.
true
if the network was modified as a result of this call@CanIgnoreReturnValue boolean addEdge(N nodeU, N nodeV, E edge)
edge
connecting nodeU
to nodeV
. In an undirected network, the edge
will also connect nodeV
to nodeU
.
Edges must be unique, just as Map
keys must be. They must also be non-null.
If nodeU
and nodeV
are not already present in this graph, this method will
silently add
nodeU
and nodeV
to the graph.
If edge
already connects nodeU
to nodeV
(in the specified order if
this network Network.isDirected()
, else in any order), then this method will have no effect.
true
if the network was modified as a result of this callIllegalArgumentException
- if edge
already exists and does not connect nodeU
to nodeV
, or if the introduction of the edge would violate Network.allowsParallelEdges()
or Network.allowsSelfLoops()
@CanIgnoreReturnValue boolean removeNode(N node)
node
if it is present; all edges incident to node
will also be removed.true
if the network was modified as a result of this call@CanIgnoreReturnValue boolean removeEdge(E edge)
edge
from this network, if it is present.true
if the network was modified as a result of this callCopyright © 2010–2017. All rights reserved.