| java.lang.Object org.quilt.graph.Directed
All known Subclasses: org.quilt.cl.ControlFlowGraph,
Directed | public class Directed (Code) | | A graph consisting of vertices connected by directed, weighted edges.
The graph is guaranteed to have at least an entry and an exit point
and to always be well-formed, in the sense that
- there will be a path from the entry vertex to any other vertex
in the graph, and
- there will be a path from any vertex in the graph to the exit
vertex
These graphs may be nested. In such a case
- both graphs will be well-formed
- the entry and exit points of the subgraph are in the graph
- all paths from the entry point of the parent to a point in the
subgraph will pass through the entry point of the subgraph
- all paths from a vertex within the subgraph to a vertex in the
parent graph will pass through the exit vertex of the subgraph
author: Jim Dixon |
Field Summary | |
protected static int | graphIndex Index of most recently built graph. |
Constructor Summary | |
public | Directed() Builds a root directed graph with two vertices and two edges. | protected | Directed(Directed parent) Subgraph constructor; will have depth one more than parent. |
Method Summary | |
public int | anotherEdge(Edge e) Step edge count.
Parameters: e - Edge being added. | public int | anotherVertex(Vertex v) Step count of vertices .
Parameters: v - Vertex being added. | public static void | checkForNull(Object o, String what) | public Entry | closestEntry(Directed g) If the edge points towards a vertex in a graph which is enclosed
within the current graph, return a reference to the closest Entry.
The vertex might be within a nested subgraph. | final protected static Directed | connectSubgraph(Directed subgraph, Edge e, int n) Inserts a subgraph into an edge, putting the entry and exit points
on the edge presented. | public int | getDepth() The depth of this graph. | public Entry | getEntry() The entry vertex of this graph. | public Exit | getExit() The exit vertex of this graph. | public int | getIndex() The zero-based index of this graph. | public Directed | getParent() The parent graph to this graph, or null if there is none. | final protected Vertex | insertVertex(Vertex v, Edge e) Insert a (new) Vertex into the graph along the edge provided. | public Vertex | insertVertex(Edge e) Create a new Vertex with a Unary connector and insert into
this graph's edge e. | public int | size() | public Directed | subgraph(Edge e, int n) Constructs a subgraph and inserts it into the parent graph
on the edge presented. |
graphIndex | protected static int graphIndex(Code) | | Index of most recently built graph.
|
Directed | public Directed()(Code) | | Builds a root directed graph with two vertices and two edges. The
two vertices are Entry and Exit types. There is an edge from
entry to exit and another from exit back to entry. Each is
constained in a UnaryConnector. Vertices are added to the graph
by inserting them along the entry-to-exit edge.
See Also: Connector See Also: Edge |
Directed | protected Directed(Directed parent)(Code) | | Subgraph constructor; will have depth one more than parent.
Parameters: parent - Graph in which this is a subgraph. Parameters: n - Number of extra edges |
anotherEdge | public int anotherEdge(Edge e)(Code) | | Step edge count.
Parameters: e - Edge being added. Ignored at the moment. |
anotherVertex | public int anotherVertex(Vertex v)(Code) | | Step count of vertices .
Parameters: v - Vertex being added. Being ignored at the moment. |
closestEntry | public Entry closestEntry(Directed g)(Code) | | If the edge points towards a vertex in a graph which is enclosed
within the current graph, return a reference to the closest Entry.
The vertex might be within a nested subgraph. If it is not in a
descendent graph, return null.
Parameters: e - Edge towards vertex in lower-level graph. Parameters: g - Candidate lower-level graph. A reference to the nearest Entry point or null. |
connectSubgraph | final protected static Directed connectSubgraph(Directed subgraph, Edge e, int n)(Code) | | Inserts a subgraph into an edge, putting the entry and exit points
on the edge presented. On exit the original edge has been
retargeted to the Entry of the subgraph.
Parameters: e - An edge in the parent graph. A reference to the subgraph. |
getDepth | public int getDepth()(Code) | | The depth of this graph. |
getEntry | public Entry getEntry()(Code) | | The entry vertex of this graph. |
getExit | public Exit getExit()(Code) | | The exit vertex of this graph. |
getIndex | public int getIndex()(Code) | | The zero-based index of this graph. |
getParent | public Directed getParent()(Code) | | The parent graph to this graph, or null if there is none. |
insertVertex | final protected Vertex insertVertex(Vertex v, Edge e)(Code) | | Insert a (new) Vertex into the graph along the edge provided.
After this operation the target of the edge will be the new
vertex.
Parameters: v - Vertex to be inserted. Parameters: e - Edge it is to be inserted along. |
insertVertex | public Vertex insertVertex(Edge e)(Code) | | Create a new Vertex with a Unary connector and insert into
this graph's edge e.
|
subgraph | public Directed subgraph(Edge e, int n)(Code) | | Constructs a subgraph and inserts it into the parent graph
on the edge presented. This is a wrapper around the method
that does the connecting; when extending the class, override
the wrapper.
Parameters: e - An edge in the parent graph. A reference to the subgraph. |
|
|