MutableValueGraph that supports both directed and undirected
graphs. Instances of this class should be constructed with ValueGraphBuilder.
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 ElementOrder |
| Access | Constructor and Description |
|---|---|
| pack-priv | StandardMutableValueGraph(AbstractGraphBuilder<? super N> builder)
Constructs a mutable graph with the properties specified in |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | addNode(N node)
Implements com. node if it is not already present.
|
| private GraphConnections | |
| public ElementOrder | incidentEdgeOrder()
Overrides com. Implements com. ElementOrder that specifies the order of iteration for the elements of
edges(), adjacentNodes(Object), predecessors(Object), successors(Object) and incidentEdges(Object).
|
| private GraphConnections | |
| public V | putEdgeValue(N nodeU, N nodeV, V value)
Implements com. nodeU to nodeV if one is not already present, and sets
a value for that edge to value (overwriting the existing value, if any).
|
| public V | putEdgeValue(EndpointPair<N> endpoints, V value)
Implements com. endpoints if one is not already present, and sets a value for
that edge to value (overwriting the existing value, if any).
|
| public V | removeEdge(N nodeU, N nodeV)
Implements com. nodeU to nodeV, if it is present.
|
| public V | 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.
|
| incidentEdgeOrder | back to summary |
|---|---|
| private final ElementOrder<N> incidentEdgeOrder | |
| StandardMutableValueGraph | back to summary |
|---|---|
| pack-priv StandardMutableValueGraph(AbstractGraphBuilder<? super N> builder) Constructs a mutable graph with the properties specified in | |
| addNode | back to summary |
|---|---|
| public boolean addNode(N node) Implements com. Doc from com. Adds Nodes must be unique, just as
| |
| addNodeInternal | back to summary |
|---|---|
| private GraphConnections Adds
| |
| incidentEdgeOrder | back to summary |
|---|---|
| public ElementOrder Overrides com. Implements com. Doc from com. Returns an
| |
| newConnections | back to summary |
|---|---|
| private GraphConnections | |
| putEdgeValue | back to summary |
|---|---|
| public V putEdgeValue(N nodeU, N nodeV, V value) 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. Values do not have to be unique. However, values must be non-null. If
| |
| putEdgeValue | back to summary |
|---|---|
| public V putEdgeValue(EndpointPair<N> endpoints, V value) 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 this graph is directed, Values do not have to be unique. However, values must be non-null. If either or both endpoints are not already present in this graph, this method will silently
| |
| removeEdge | back to summary |
|---|---|
| public V removeEdge(N nodeU, N nodeV) Implements com. Doc from com. Removes the edge connecting
| |
| removeEdge | back to summary |
|---|---|
| public V 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
| |