MutableGraph that supports both directed and undirected
graphs. Instances of this class should be constructed with GraphBuilder.
Time complexities for mutation methods are all O(1) except for removeNode(N node),
which is in O(d_node) where d_node is the degree of node.
| Modifier and Type | Field and Description |
|---|---|
| private final MutableValueGraph |
| Access | Constructor and Description |
|---|---|
| pack-priv | StandardMutableGraph(AbstractGraphBuilder<? super N> builder)
Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | addNode(N node)
Implements com. node if it is not already present.
|
| pack-priv BaseGraph | |
| public boolean | putEdge(N nodeU, N nodeV)
Implements com. nodeU to nodeV if one is not already present.
|
| public boolean | putEdge(EndpointPair<N> endpoints)
Implements com. endpoints (in the order, if any, specified by endpoints) if one is not already present.
|
| public boolean | removeEdge(N nodeU, N nodeV)
Implements com. nodeU to nodeV, if it is present.
|
| public boolean | removeEdge(EndpointPair<N> endpoints)
Implements com. endpoints, if it is present.
|
| public boolean | removeNode(N node)
Implements com. node if it is present; all edges incident to node will also be removed.
|
| backingValueGraph | back to summary |
|---|---|
| private final MutableValueGraph<N, GraphConstants. | |
| StandardMutableGraph | back to summary |
|---|---|
| pack-priv StandardMutableGraph(AbstractGraphBuilder<? super N> builder) Constructs a | |
| addNode | back to summary |
|---|---|
| public boolean addNode(N node) Implements com. Doc from com. Adds Nodes must be unique, just as
| |
| delegate | back to summary |
|---|---|
| pack-priv BaseGraph Implements abstract com.
| |
| putEdge | back to summary |
|---|---|
| public boolean putEdge(N nodeU, N nodeV) Implements com. Doc from com. Adds an edge connecting If the graph is directed, the resultant edge will be directed; otherwise, it will be undirected. If
| |
| putEdge | back to summary |
|---|---|
| public boolean putEdge(EndpointPair<N> endpoints) Implements com. Doc from com. Adds an edge connecting If this graph is directed, If this graph is directed, If either or both endpoints are not already present in this graph, this method will silently
| |
| removeEdge | back to summary |
|---|---|
| public boolean removeEdge(N nodeU, N nodeV) Implements com. Doc from com. Removes the edge connecting
| |
| removeEdge | back to summary |
|---|---|
| public boolean removeEdge(EndpointPair<N> endpoints) Implements com. Doc from com. Removes the edge connecting If this graph is directed,
| |
| removeNode | back to summary |
|---|---|
| public boolean removeNode(N node) Implements com. Doc from com. Removes
| |