|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.neu.ccs.demeter.aplib.Traversal
|
+--edu.neu.ccs.demeter.aplib.TraversalGraph
A traversal graph TG(S,G,N,B) is constructed from an encapsulated strategy S, a class graph G, a name map N for S and G, and a constraint map B for S and G according to a modified version of Algorithm 1 in the paper "Traversals of Object Structures: Specification and Efficient Implementation" (the modifications allow G to be non-simple and N to be a relation instead of a function). TG is essentially a compilation (that is, a compact and efficient generator) of the set of paths through G that is selected by S. Conceptually, TG(S,G,N,B) consists of a graph G'' and a set Ts of start nodes in G'', where G'' is (a subset of) n copies of G, where n is the number of edges in S, with some extra edges to connect nodes in different copies. However, to keep the representation more compact, G'' is represented as two sets, NS and ES:
-l-> v, IM)
where u -l-> v is an edge
in G and IM is a set of pairs of indices (i,j) such that
ui -l-> vj is in G''.
| Nested Class Summary | |
class |
TraversalGraph.EdgeSet
A set of edges u^i -l-> v^j in a traversal graph, where the
edges in the set are all copies of the same class graph edge
u -l-> v with different endpoint indices i and j. |
class |
TraversalGraph.IndexPair
A pair of indices, representing the copy indices on the source and target of an edge in the traversal graph. |
class |
TraversalGraph.NodeSet
A set of nodes vi in a traversal graph, where the nodes in the set are all copies of the same class graph node v with different indices i. |
| Nested classes inherited from class edu.neu.ccs.demeter.aplib.Traversal |
|
| Field Summary | |
static boolean |
debug
Set this for debugging output. |
| Constructor Summary | |
TraversalGraph(SimpleStrategyI S,
ClassGraphI G)
Compute the traversal graph TG(S,G,I,BTRUE) and start and finish sets Ts and Tf, where I is the identity map and BTRUE returns true for all graph elements. |
|
TraversalGraph(SimpleStrategyI S,
ClassGraphI G,
NameMapI N,
ConstraintMapI B)
Compute the traversal graph TG(S,G,N,B) and start and finish sets Ts and Tf. |
|
| Method Summary | |
ConstraintMapI |
getConstraintMap()
The constraint map B for S and G used in computing this traversal graph. |
Traversal.EdgeSet |
getEdgeSet(String key)
The set of copies of the class graph edge with the given key in the traversal graph, or null if there are none. |
List |
getEdgeSets()
An unmodifiable list of EdgeSet objects representing the edges in the traversal graph. |
List |
getFinishSet()
An unmodifiable List of NodeSet objects representing the finish set of the traversal (Tf). |
Traversal.NodeSet |
getFinishSet(Object v)
A NodeSet representing the finish set of tokens (indices) for the class graph node v, or null if v has no finish tokens in the traversal. |
NameMapI |
getNameMap()
The name map N for S and G used in computing this traversal graph. |
Traversal.NodeSet |
getNodeSet(Object v)
The set of copies of class graph node v in the traversal graph, or null if there are none. |
List |
getNodeSets()
An unmodifiable list of NodeSet objects representing the nodes in the traversal graph. |
List |
getStartSet()
An unmodifiable List of NodeSet objects representing the start set of the traversal (Ts). |
Traversal.NodeSet |
getStartSet(Object v)
A NodeSet representing the start set of tokens (indices) for the class graph node v, or null if v has no start tokens in the traversal. |
SimpleStrategyI |
getStrategy()
The strategy S used in computing this traversal graph. |
String |
toString()
A string representation of the graph. |
| Methods inherited from class edu.neu.ccs.demeter.aplib.Traversal |
compute, compute, edgeKey, getAlternationEdgeSet, getClassGraph, getConstructionEdgeSet, getEdgeSet, getInheritanceEdgeSet, getVersion, intersect, toCompactString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static boolean debug
| Constructor Detail |
public TraversalGraph(SimpleStrategyI S,
ClassGraphI G)
throws TraversalException
TraversalException - if the resulting traversal
graph is empty.
public TraversalGraph(SimpleStrategyI S,
ClassGraphI G,
NameMapI N,
ConstraintMapI B)
throws TraversalException
TraversalException - if:
| Method Detail |
public SimpleStrategyI getStrategy()
public NameMapI getNameMap()
public ConstraintMapI getConstraintMap()
public List getNodeSets()
getNodeSets in class TraversalTraversalGraph.NodeSetpublic Traversal.NodeSet getNodeSet(Object v)
getNodeSet in class Traversalpublic List getEdgeSets()
getEdgeSets in class TraversalTraversalGraph.EdgeSetpublic Traversal.EdgeSet getEdgeSet(String key)
getEdgeSet in class Traversalpublic List getStartSet()
Traversal
getStartSet in class Traversalpublic Traversal.NodeSet getStartSet(Object v)
Traversal
getStartSet in class Traversalpublic List getFinishSet()
Traversal
getFinishSet in class Traversalpublic Traversal.NodeSet getFinishSet(Object v)
Traversal
getFinishSet in class Traversalpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||