![]() |
lingua-franca 0.10.1
Lingua Franca code generator
|
Directed graph that maps nodes to its upstream and downstream neighbors. More...
Inherits org.lflang.graph.Graph< T >.
Inherited by org.lflang.analyses.statespace.StateSpaceDiagram, and org.lflang.graph.PrecedenceGraph< T extends Object >.
Public Member Functions | |
| void | addEdge (T sink, T source) |
| Add a new directed edge to the graph. | |
| void | addEdges (T sink, List< T > sources) |
| Add new directed edges to the graph. | |
| void | addNode (T node) |
| Add the given node to the graph. | |
| void | clear () |
| DirectedGraph< T > | copy () |
| Obtain a copy of this graph by creating an new instance and copying the adjacency maps. | |
| int | edgeCount () |
| Return the number of directed edges in this graph. | |
| Set< T > | getDownstreamAdjacentNodes (T node) |
| Return all immediate downstream neighbors of a given node. | |
| Set< T > | getUpstreamAdjacentNodes (T node) |
| Return all immediate upstream neighbors of a given node. | |
| boolean | hasNode (T node) |
| Return true if this graph has the given node in it. | |
| Set< T > | leafNodes () |
| Return the leaf nodes of this graph. | |
| void | merge (DirectedGraph< T > another) |
| Merge another directed graph into this one. | |
| int | nodeCount () |
| Return the number of nodes in this graph. | |
| Set< T > | nodes () |
| Return an unmodifiable set of nodes in this graph. | |
| void | removeEdge (T sink, T source) |
| Remove a directed edge from the graph. | |
| void | removeNode (T node) |
| Remove the given node from the graph. | |
| Set< T > | rootNodes () |
| Return the root nodes of this graph. | |
| String | toDOT () |
| Return the DOT (GraphViz) representation of the graph. | |
| String | toString () |
| Return a textual list of the nodes. | |
Protected Member Functions | |
| void | graphChanged () |
| Mark the graph to have changed so that any cached analysis is refreshed accordingly. | |
Directed graph that maps nodes to its upstream and downstream neighbors.
| void org.lflang.graph.DirectedGraph< T >.addEdge | ( | T | sink, |
| T | source ) |
Add a new directed edge to the graph.
The first argument is the downstream node, the second argument the upstream node. If either argument is null, do nothing.
| sink | The downstream immediate neighbor. |
| source | The upstream immediate neighbor. |
Implements org.lflang.graph.Graph< T >.
| void org.lflang.graph.DirectedGraph< T >.addEdges | ( | T | sink, |
| List< T > | sources ) |
Add new directed edges to the graph.
The first argument is the downstream node, the second argument a set of upstream nodes.
| sink | The downstream immediate neighbor. |
| sources | The upstream immediate neighbors. |
Implements org.lflang.graph.Graph< T >.
| void org.lflang.graph.DirectedGraph< T >.addNode | ( | T | node | ) |
Add the given node to the graph.
Implements org.lflang.graph.Graph< T >.
| void org.lflang.graph.DirectedGraph< T >.clear | ( | ) |
| DirectedGraph< T > org.lflang.graph.DirectedGraph< T >.copy | ( | ) |
Obtain a copy of this graph by creating an new instance and copying the adjacency maps.
| int org.lflang.graph.DirectedGraph< T >.edgeCount | ( | ) |
Return the number of directed edges in this graph.
Implements org.lflang.graph.Graph< T >.
| Set< T > org.lflang.graph.DirectedGraph< T >.getDownstreamAdjacentNodes | ( | T | node | ) |
Return all immediate downstream neighbors of a given node.
| node | The node to report the immediate downstream neighbors of. |
| Set< T > org.lflang.graph.DirectedGraph< T >.getUpstreamAdjacentNodes | ( | T | node | ) |
Return all immediate upstream neighbors of a given node.
| node | The node to report the immediate upstream neighbors of. |
|
protected |
Mark the graph to have changed so that any cached analysis is refreshed accordingly.
Reimplemented in org.lflang.graph.PrecedenceGraph< T extends Object >.
| boolean org.lflang.graph.DirectedGraph< T >.hasNode | ( | T | node | ) |
Return true if this graph has the given node in it.
| node | The node to look for. |
Implements org.lflang.graph.Graph< T >.
| Set< T > org.lflang.graph.DirectedGraph< T >.leafNodes | ( | ) |
Return the leaf nodes of this graph.
Leaf nodes have no downstream neighbors.
| void org.lflang.graph.DirectedGraph< T >.merge | ( | DirectedGraph< T > | another | ) |
Merge another directed graph into this one.
| another | The graph to merge into this one. |
| int org.lflang.graph.DirectedGraph< T >.nodeCount | ( | ) |
Return the number of nodes in this graph.
Implements org.lflang.graph.Graph< T >.
| Set< T > org.lflang.graph.DirectedGraph< T >.nodes | ( | ) |
Return an unmodifiable set of nodes in this graph.
Implements org.lflang.graph.Graph< T >.
| void org.lflang.graph.DirectedGraph< T >.removeEdge | ( | T | sink, |
| T | source ) |
Remove a directed edge from the graph.
| sink | The downstream immediate neighbor. |
| source | The upstream immediate neighbor. |
Implements org.lflang.graph.Graph< T >.
| void org.lflang.graph.DirectedGraph< T >.removeNode | ( | T | node | ) |
Remove the given node from the graph.
This also eliminates any edges from upstream and to downstream neighbors of this node.
| node | The node to remove. |
Implements org.lflang.graph.Graph< T >.
| Set< T > org.lflang.graph.DirectedGraph< T >.rootNodes | ( | ) |
Return the root nodes of this graph.
Root nodes have no upstream neighbors.
| String org.lflang.graph.DirectedGraph< T >.toDOT | ( | ) |
Return the DOT (GraphViz) representation of the graph.
Implements org.lflang.graph.Graph< T >.
Reimplemented in org.lflang.generator.ReactionInstanceGraph.
| String org.lflang.graph.DirectedGraph< T >.toString | ( | ) |
Return a textual list of the nodes.