|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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<JmiClassVertex,org.jgrapht.graph.DefaultEdge> org.eigenbase.jmi.JmiModelGraph
public class JmiModelGraph
JmiModelGraph is a directed graph representation of a JMI model. Vertices are
instances of JmiClassVertex
. Edges are instances of either JmiInheritanceEdge
or JmiAssocEdge
. Graph instances are immutable
and can be accessed concurrently by multiple threads.
Field Summary | |
---|---|
private org.jgrapht.DirectedGraph<JmiClassVertex,org.jgrapht.graph.DefaultEdge> |
assocGraph
Subgraph with just inheritance edges. |
private ClassLoader |
classLoader
Class loader to instantiate MDR classes. |
private org.jgrapht.DirectedGraph<JmiClassVertex,org.jgrapht.graph.DefaultEdge> |
combinedGraph
The underlying graph structure; we hide it here so that it can only be modified internally. |
private org.jgrapht.DirectedGraph<JmiClassVertex,JmiInheritanceEdge> |
inheritanceGraph
Subgraph with just inheritance edges. |
private Map<Object,Object> |
map
Map from Ref and Mof instances to corresponding graph vertices and edges. |
private RefPackage |
refRootPackage
|
private boolean |
strict
|
private org.jgrapht.DirectedGraph<JmiClassVertex,org.jgrapht.graph.DefaultEdge> |
unmodifiableAssocGraph
Unmodifiable view of assocGraph. |
private org.jgrapht.DirectedGraph<JmiClassVertex,JmiInheritanceEdge> |
unmodifiableInheritanceGraph
Unmodifiable view of inheritanceGraph. |
Constructor Summary | |
---|---|
|
JmiModelGraph(RefPackage refRootPackage)
Creates a new graph based on the contents of a RefPackage and all of its subpackages. |
|
JmiModelGraph(RefPackage refRootPackage,
ClassLoader classLoader,
boolean strict)
Creates a new graph based on the contents of a RefPackage and all of its subpackages, with control over strictness. |
private |
JmiModelGraph(RefPackage refRootPackage,
ClassLoader classLoader,
org.jgrapht.DirectedGraph<JmiClassVertex,org.jgrapht.graph.DefaultEdge> combinedGraph,
boolean strict)
|
Method Summary | |
---|---|
private void |
addMofAssoc(Association mofAssoc)
|
private JmiClassVertex |
addMofClass(MofClass mofClass)
|
private void |
addMofPackage(MofPackage mofPackage)
|
private void |
addRefAssoc(RefAssociation refAssoc)
|
private void |
addRefClass(RefClass refClass)
|
private void |
addRefPackage(RefPackage refPackage)
|
org.jgrapht.DirectedGraph<JmiClassVertex,org.jgrapht.graph.DefaultEdge> |
getAssocGraph()
|
JmiAssocEdge |
getEdgeForAssocName(String name)
Gets the edge representing a MOF association by name. |
JmiAssocEdge |
getEdgeForMofAssoc(Association mofAssoc)
Gets the edge representing a MOF association. |
JmiAssocEdge |
getEdgeForRefAssoc(RefAssociation refAssoc)
Gets the edge representing a JMI reflective association. |
org.jgrapht.DirectedGraph<JmiClassVertex,JmiInheritanceEdge> |
getInheritanceGraph()
|
Association |
getMofAssocForEdge(JmiAssocEdge edge)
Gets the MOF representation for an association. |
MofClass |
getMofClassForVertex(JmiClassVertex vertex)
Gets the MOF representation for a class. |
RefAssociation |
getRefAssocForEdge(JmiAssocEdge edge)
Gets the JMI reflective representation for an association. |
RefClass |
getRefClassForVertex(JmiClassVertex vertex)
Gets the JMI reflective representation for a class. |
RefPackage |
getRefRootPackage()
|
JmiClassVertex |
getVertexForClassName(String name)
Gets the vertex representing a MOF class by name. |
JmiClassVertex |
getVertexForJavaInterface(Class javaInterface)
Gets the vertex representing a Java interface. |
JmiClassVertex |
getVertexForMofClass(MofClass mofClass)
Gets the vertex representing a MOF class. |
JmiClassVertex |
getVertexForRefClass(RefClass refClass)
Gets the vertex representing a class from JMI reflection. |
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 class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 |
Field Detail |
---|
private final ClassLoader classLoader
private final org.jgrapht.DirectedGraph<JmiClassVertex,org.jgrapht.graph.DefaultEdge> combinedGraph
private final org.jgrapht.DirectedGraph<JmiClassVertex,JmiInheritanceEdge> inheritanceGraph
private final org.jgrapht.DirectedGraph<JmiClassVertex,JmiInheritanceEdge> unmodifiableInheritanceGraph
private final org.jgrapht.DirectedGraph<JmiClassVertex,org.jgrapht.graph.DefaultEdge> assocGraph
private final org.jgrapht.DirectedGraph<JmiClassVertex,org.jgrapht.graph.DefaultEdge> unmodifiableAssocGraph
private final Map<Object,Object> map
private final RefPackage refRootPackage
private final boolean strict
Constructor Detail |
---|
public JmiModelGraph(RefPackage refRootPackage)
refRootPackage
- package on which graph is basedpublic JmiModelGraph(RefPackage refRootPackage, ClassLoader classLoader, boolean strict)
refRootPackage
- package on which graph is basedclassLoader
- class loader, or null to use the system defaultstrict
- true to prevent dangling references in model; false to
ignore themprivate JmiModelGraph(RefPackage refRootPackage, ClassLoader classLoader, org.jgrapht.DirectedGraph<JmiClassVertex,org.jgrapht.graph.DefaultEdge> combinedGraph, boolean strict)
Method Detail |
---|
public org.jgrapht.DirectedGraph<JmiClassVertex,JmiInheritanceEdge> getInheritanceGraph()
public org.jgrapht.DirectedGraph<JmiClassVertex,org.jgrapht.graph.DefaultEdge> getAssocGraph()
public JmiClassVertex getVertexForRefClass(RefClass refClass)
refClass
- the class of interest
public JmiClassVertex getVertexForMofClass(MofClass mofClass)
mofClass
- the class of interest
public JmiClassVertex getVertexForJavaInterface(Class javaInterface)
javaInterface
- the Java interface of interest
public JmiAssocEdge getEdgeForMofAssoc(Association mofAssoc)
mofAssoc
- the association of interest
public JmiAssocEdge getEdgeForRefAssoc(RefAssociation refAssoc)
refAssoc
- the association of interest
public JmiClassVertex getVertexForClassName(String name)
name
- name of the class of interest
public JmiAssocEdge getEdgeForAssocName(String name)
name
- name of the association of interest
public RefClass getRefClassForVertex(JmiClassVertex vertex)
vertex
- vertex representing class of interest
public MofClass getMofClassForVertex(JmiClassVertex vertex)
vertex
- vertex representing class of interest
public Association getMofAssocForEdge(JmiAssocEdge edge)
edge
- edge representing association of interest
public RefAssociation getRefAssocForEdge(JmiAssocEdge edge)
edge
- edge representing association of interest
public RefPackage getRefRootPackage()
private void addMofPackage(MofPackage mofPackage)
private JmiClassVertex addMofClass(MofClass mofClass)
private void addMofAssoc(Association mofAssoc)
private void addRefPackage(RefPackage refPackage)
private void addRefClass(RefClass refClass)
private void addRefAssoc(RefAssociation refAssoc)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |