public interface MutableEdgeLabelledDirectedGraph<N,L> extends DirectedGraph<N>
Modifier and Type | Method and Description |
---|---|
void |
addEdge(N from,
N to,
L label)
Adds an edge to the graph between 2 nodes.
|
void |
addNode(N node)
Adds a node to the graph.
|
boolean |
containsAnyEdge(L label) |
boolean |
containsAnyEdge(N from,
N to) |
boolean |
containsEdge(N from,
N to,
L label) |
boolean |
containsNode(N node) |
MutableDirectedGraph<N> |
getEdgesForLabel(L label)
Returns a MutableDirectedGraph consisting of
all edges with the given label and their nodes.
|
List<L> |
getLabelsForEdges(N from,
N to)
Returns a list of labels for which an edge exists between from and to
|
List<N> |
getNodes() |
void |
removeAllEdges(L label)
Removes all edges with the given label in the graph.
|
void |
removeAllEdges(N from,
N to)
Removes all edges between 2 nodes in the graph.
|
void |
removeEdge(N from,
N to,
L label)
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
forEach, spliterator
void addEdge(N from, N to, L label)
from
- out node for the edge.to
- in node for the edge.label
- label for the edge.List<L> getLabelsForEdges(N from, N to)
from
- out node for the edges to remove.to
- in node for the edges to remove.MutableDirectedGraph<N> getEdgesForLabel(L label)
label
- label for the edge to remove.void removeEdge(N from, N to, L label)
from
- out node for the edges to remove.to
- in node for the edges to remove.label
- label for the edge to remove.void removeAllEdges(N from, N to)
from
- out node for the edges to remove.to
- in node for the edges to remove.void removeAllEdges(L label)
label
- label for the edge to remove.boolean containsEdge(N from, N to, L label)
boolean containsAnyEdge(N from, N to)
from
- out node for the edges.to
- in node for the edges.boolean containsAnyEdge(L label)
label
- label for the edges.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.