java.lang.Object | |
↳ | com.microstrategy.utils.DAG |
This class represents a generic Directed Acyclic Graph. There are a number of inner classes that represent the parts of this DAG:
DAG.Vertex
represents a vertex in this graph.DAG.Edge
represents an edge in this graph that
connects two vertices.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | DAG.AnnotatableObject | This is a simple object which can be "annotated" with caller-specified properties. | |||||||||
class | DAG.Edge | This class represents an Edge in the Directed Acyclic Graph. | |||||||||
class | DAG.Vertex | This class represents an end point ("vertex") in a Directed Acyclic Graph. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DAG() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DAG.Edge |
addEdge(DAG.Vertex fromVertex, DAG.Vertex toVertex)
Adds an edge between two vertices.
| ||||||||||
DAG.Edge |
getEdge(DAG.Vertex fromVertex, DAG.Vertex toVertex)
Returns an Edge object which connects two Vertices.
| ||||||||||
Iterator<DAG.Edge> |
getEdges()
Returns all of the Edges in this DAG.
| ||||||||||
MessageRouter |
getMessageRouter()
Returns the Message Router instance to use with this DAG.
| ||||||||||
DAG.Vertex |
getVertex(String vertexKey, boolean create)
Returns the Vertex associated with the supplied key.
| ||||||||||
Iterator<DAG.Vertex> |
getVertices()
Returns all of the Vertices in this DAG.
| ||||||||||
void |
setMessageRouter(MessageRouter msgRouter)
Sets the Message Router instance to use with this DAG.
| ||||||||||
Iterator<DAG.Vertex> |
sinkVertices()
Returns the list of sink vertices in the DAG.
| ||||||||||
Iterator<DAG.Vertex> |
topoSort()
Performs a topological sort on the contents of this DAG.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Adds an edge between two vertices. If an edge already exists between these vertices, it is returned.
fromVertex | The DAG.Vertex that represents the "from" end. |
---|---|
toVertex | The DAG.Vertex that represents the "to" end. |
DAG.Edge
(if one exists) or a newly created
one that joins the two vertices.
Returns an Edge object which connects two Vertices. If not found, then null is returned.
fromVertex | The DAG.Vertex which is the "from" end. |
---|---|
toVertex | The DAG.Vertex which is the "to" end. |
DAG.Edge
, if it exists, or null.
Returns all of the Edges in this DAG.
DAG.Edge
objects.
Returns the Message Router instance to use with this DAG.
Returns the Vertex associated with the supplied key.
vertexKey | The key for the Vertex to return. |
---|---|
create | If true and no Vertex was found, then a new Vertex object is created and returned. Otherwise, null is returned. |
DAG.Vertex
associated with this key (or a new one if
'create' is true) or null.
Returns all of the Vertices in this DAG.
DAG.Vertex
objects.
Sets the Message Router instance to use with this DAG.
msgRouter | The Message Router instance to use with this DAG. |
---|
Returns the list of sink vertices in the DAG. A sink vertex is a vertex without an out bound edge. A DAG should contain at least one sink vertex.
DAG.Vertex
objects.
Performs a topological sort on the contents of this DAG. The results are a list of Vertices that satisfies this partial ordering.
DAG.Vertex
objects.