public interface MutableDirectedGraph<N> extends DirectedGraph<N>
Modifier and Type | Method and Description |
---|---|
void |
addEdge(N from,
N to)
Adds an edge to the graph between 2 nodes.
|
void |
addNode(N node)
Adds a node to the graph.
|
boolean |
containsEdge(N from,
N to) |
boolean |
containsNode(N node) |
java.util.List<N> |
getNodes() |
void |
removeEdge(N from,
N to)
Removes an edge between 2 nodes in the graph.
|
void |
removeNode(N node)
Removes a node from the graph.
|
getHeads, getPredsOf, getSuccsOf, getTails, iterator, size
void addEdge(N from, N to)
from
- out node for the edge.to
- in node for the edge.void removeEdge(N from, N to)
from
- out node for the edge to remove.to
- in node for the edge to remove.boolean containsEdge(N from, N to)
java.util.List<N> getNodes()
void addNode(N node)
node
- a node to add to the graph.DirectedGraph.getHeads()
,
DirectedGraph.getTails()
void removeNode(N node)
node
- the node to be removed.boolean containsNode(N node)
node
- node that we want to know if the graph constains.