|
||||||||||
| 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.dj.Traversal
A compact, efficient representation of a set of paths through a class graph that can be used to traverse an object graph.
| Nested Class Summary |
| Nested classes inherited from class edu.neu.ccs.demeter.aplib.Traversal |
Traversal.EdgeSet, Traversal.NodeSet |
| Constructor Summary | |
Traversal(Strategy s,
ClassGraph cg)
Compute the traversal determined by s and cg. |
|
Traversal(String s,
ClassGraph cg)
Compute the traversal determined by strategy s and cg. |
|
| Method Summary | |
List |
asList(Object o)
A fixed-size List backed by the object graph rooted at o. |
boolean |
equals(Object t)
|
Object |
fetch(Object o)
Fetch the object in the object graph rooted at o corresponding to the target(s) of the traversal. |
List |
gather(Object o)
Gather into a list the objects in the object graph rooted at o corresponding to the target(s) of the traversal. |
Traversal.EdgeSet |
getEdgeSet(String key)
The set of copies of the class graph edge with the given key in the traversal, or null if there are none. |
List |
getEdgeSets()
An unmodifiable list of EdgeSet objects representing the edges in the traversal. |
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. |
Traversal.NodeSet |
getNodeSet(Object v)
The set of copies of class graph node v in the traversal, or null if there are none. |
List |
getNodeSets()
An unmodifiable list of NodeSet objects representing the nodes in the traversal. |
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. |
Strategy |
getStrategy()
The strategy expression used to compute the traversal. |
static String |
getVersion()
The DJ version string. |
int |
hashCode()
|
ObjectGraphSlice |
slice(Object o)
The slice of the object graph rooted at o determined by the traversal. |
ClassGraph |
toClassGraph()
Make a class graph with just the classes and edges in the traversal. |
String |
toString()
|
Object |
traverse(Object o,
Visitor v)
Traverse the object graph rooted at o according to the traversal, visiting v at each node and returning the value of v.getReturnValue() at the end of the traversal. |
Object |
traverse(Object o,
Visitor[] v)
Traverse the object graph rooted at o according to the traversal, visiting the visitors in array v in sequence at each node and returning the value of v[0].getReturnValue() at the end of the traversal. |
| Methods inherited from class edu.neu.ccs.demeter.aplib.Traversal |
compute, compute, edgeKey, getAlternationEdgeSet, getClassGraph, getConstructionEdgeSet, getEdgeSet, getInheritanceEdgeSet, intersect, toCompactString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Traversal(Strategy s,
ClassGraph cg)
TraversalException - if the resulting traversal is
empty.
public Traversal(String s,
ClassGraph cg)
TraversalException - if the resulting traversal is
empty.| Method Detail |
public static String getVersion()
public Strategy getStrategy()
public ObjectGraphSlice slice(Object o)
public Object traverse(Object o,
Visitor v)
public Object traverse(Object o,
Visitor[] v)
public Object fetch(Object o)
throws FetchException
FetchExceptionpublic List gather(Object o)
public List asList(Object o)
TraversalSourceException - if the type of o is not a
source of the strategy.public ClassGraph toClassGraph()
public List getNodeSets()
Traversal
getNodeSets in class TraversalTraversal.NodeSetpublic Traversal.NodeSet getNodeSet(Object v)
Traversal
getNodeSet 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 List getEdgeSets()
Traversal
getEdgeSets in class TraversalTraversal.EdgeSetpublic Traversal.EdgeSet getEdgeSet(String key)
Traversal
getEdgeSet in class Traversalpublic String toString()
toString in class Objectpublic boolean equals(Object t)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||