org.eigenbase.jmi
Class JmiDependencyGraph
java.lang.Object
org.jgrapht.graph.AbstractGraph<V,E>
org.jgrapht.graph.GraphDelegator<V,E>
org.jgrapht.graph.UnmodifiableGraph<V,E>
org.jgrapht.graph.UnmodifiableDirectedGraph<JmiDependencyVertex,org.jgrapht.graph.DefaultEdge>
org.eigenbase.jmi.JmiDependencyGraph
- All Implemented Interfaces:
- Serializable, org.jgrapht.DirectedGraph<JmiDependencyVertex,org.jgrapht.graph.DefaultEdge>, org.jgrapht.Graph<JmiDependencyVertex,org.jgrapht.graph.DefaultEdge>
public class JmiDependencyGraph
- extends org.jgrapht.graph.UnmodifiableDirectedGraph<JmiDependencyVertex,org.jgrapht.graph.DefaultEdge>
JmiDependencyGraph is a directed graph representation of the dependencies
spanning a set of JMI objects. Vertices are instances of JmiDependencyVertex
. Graph instances are immutable and can be accessed
concurrently by multiple threads.
The rules for determining dependencies from a set of JMI objects and their
associations are supplied to the constructor via an instance of JmiDependencyTransform
. This allows the caller to define the dependencies of
interest for a particular model or application.
- Version:
- $Id: //open/dev/farrago/src/org/eigenbase/jmi/JmiDependencyGraph.java#12 $
- Author:
- John V. Sichi
- See Also:
- Serialized Form
Methods inherited from class org.jgrapht.graph.UnmodifiableGraph |
addEdge, addEdge, addVertex, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex |
Methods inherited from class org.jgrapht.graph.GraphDelegator |
containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, incomingEdgesOf, inDegreeOf, outDegreeOf, outgoingEdgesOf, setEdgeWeight, toString, vertexSet |
Methods inherited from class org.jgrapht.graph.AbstractGraph |
assertVertexExist, containsEdge, removeAllEdges, toStringFromSets |
Methods inherited from interface org.jgrapht.DirectedGraph |
incomingEdgesOf, inDegreeOf, outDegreeOf, outgoingEdgesOf |
Methods inherited from interface org.jgrapht.Graph |
addEdge, addEdge, addVertex, containsEdge, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex, vertexSet |
mutableGraph
private final org.jgrapht.DirectedGraph<JmiDependencyVertex,org.jgrapht.graph.DefaultEdge> mutableGraph
- The underlying graph structure; we hide it here so that it can only be
modified internally.
transform
private final JmiDependencyTransform transform
vertexMap
private Map<RefObject,JmiDependencyVertex> vertexMap
hierarchyGraph
private org.jgrapht.DirectedGraph<JmiDependencyVertex,org.jgrapht.graph.DefaultEdge> hierarchyGraph
JmiDependencyGraph
public JmiDependencyGraph(Collection<RefObject> elements,
JmiDependencyTransform transform)
- Creates a new dependency graph.
- Parameters:
elements
- the elements among which dependencies are to be
determinedtransform
- rules for finding dependencies and grouping elements
JmiDependencyGraph
private JmiDependencyGraph(Collection<RefObject> elements,
JmiDependencyTransform transform,
org.jgrapht.DirectedGraph<JmiDependencyVertex,org.jgrapht.graph.DefaultEdge> mutableGraph)
getVertexMap
public Map<RefObject,JmiDependencyVertex> getVertexMap()
- Returns:
- an immutable map from an object in the graph to its containing
JmiDependencyVertex
getHierarchyGraph
public org.jgrapht.DirectedGraph<JmiDependencyVertex,org.jgrapht.graph.DefaultEdge> getHierarchyGraph()
- Returns:
- immutable graph of hierarchy relationships imposed on vertices
addElements
private void addElements(Collection<RefObject> elements)
addDependencyEdges
private void addDependencyEdges(Collection<RefObject> elements,
JmiAssocMapping mapping)
addHierarchyEdges
private void addHierarchyEdges(Collection<RefObject> elements)
addElementToVertex
private void addElementToVertex(RefObject refObj,
JmiDependencyVertex vertex)