|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.neu.ccs.demeter.aplib.cd.ClassGraph
|
+--edu.neu.ccs.demeter.dj.ClassGraph
A graph whose nodes are classes and whose edges are subclass, superclass, and part-of relationships between classes.
| Nested Class Summary | |
protected class |
ClassGraph.Added
Values in the classesAdded map. |
| Field Summary | |
protected Map |
classesAdded
A table of classes and what parts have been added. |
static boolean |
debug
|
protected Map |
namesClasses
|
protected Set |
packages
The set of packages that have been added. |
| Fields inherited from class edu.neu.ccs.demeter.aplib.cd.ClassGraph |
classes, preamble |
| Constructor Summary | |
ClassGraph()
Make a class graph from all classes in the default package, including all non-static fields and non-static non-void no-argument methods. |
|
ClassGraph(boolean f,
boolean m)
Make a class graph from all classes in the default package. |
|
ClassGraph(ClassGraph cg,
Strategy s)
Make a class graph with just the classes and edges in cg
reachable by following s. |
|
ClassGraph(ClassGraph cg,
String s)
Make a class graph with just the classes and edges in cg
reachable by following strategy s. |
|
ClassGraph(String pkg)
Make a class graph from all classes in the package named pkg,
including all non-static fields and non-static non-void no-argument
methods. |
|
ClassGraph(String pkg,
boolean f,
boolean m)
Make a class graph from all classes in the package named pkg.
|
|
ClassGraph(Traversal tg)
Make a class graph with just the classes and edges in tg. |
|
| Method Summary | |
void |
addClass(Class cl)
Add cl and all its non-static members to the class graph
as construction edges, if they haven't already been added. |
void |
addClass(Class cl,
boolean addFields,
boolean addMethods)
Add cl to the class graph, if it hasn't already been added.
|
Part |
addConstructionEdge(Field field)
Add a field as a construction edge. |
Part |
addConstructionEdge(Method method)
Add a no-args method as a construction edge. |
Part |
addConstructionEdge(String source,
Field field)
Add a field as a construction edge. |
Part |
addConstructionEdge(String source,
Method method)
Add a no-args method as a construction edge. |
Part |
addConstructionEdge(String source,
String label,
Class target)
Add a class member as a construction edge. |
void |
addPackage(String p)
Add all classes in package p that can be found on the
class path. |
void |
addRepetitionEdge(String source,
String target)
Add a repetition edge from source to target. |
List |
asList(Object o,
Strategy s)
A fixed-size List backed by the object graph rooted at o. |
List |
asList(Object o,
String s)
A fixed-size List backed by the object graph rooted at o. |
Object |
fetch(Object o,
Strategy s)
Fetch the object in the object graph rooted at o corresponding to the target of s. |
Object |
fetch(Object o,
String s)
Fetch the object in the object graph rooted at o corresponding to the target of strategy s. |
List |
gather(Object o,
Strategy s)
Gather into a list the objects in the object graph rooted at o corresponding to the target of s. |
List |
gather(Object o,
String s)
Gather the objects in the object graph rooted at o corresponding to the target of strategy s. |
Class |
getClassNamed(String name)
The Class object corresponding to the node named name. |
Class |
getNodeClass(Object node)
The Class object corresponding to the node o. |
static String |
getVersion()
The DJ version string. |
static boolean |
isRepetitionEdge(EdgeI edge)
|
static void |
main(String[] args)
Testing stub. |
ObjectGraphSlice |
slice(Object o,
Strategy s)
The slice of the object graph rooted at o determined by s. |
ObjectGraphSlice |
slice(Object o,
String s)
The slice of the object graph rooted at o determined by strategy s. |
Object |
traverse(Object o,
Strategy s,
Visitor v)
Traverse the object graph rooted at o along s, visiting v at each node and returning the value of v.getReturnValue() at the end of the traversal. |
Object |
traverse(Object o,
Strategy s,
Visitor[] v)
Traverse the object graph rooted at o along s, 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. |
Object |
traverse(Object o,
String s,
Visitor v)
Traverse the object graph rooted at o along strategy s using v, returning the value of v.getReturnValue() at the end of the traversal. |
Object |
traverse(Object o,
String s,
Visitor[] v)
Traverse the object graph rooted at o along strategy s using visitors in array v in parallel, returning the value of v[0].getReturnValue() at the end of the traversal. |
static String |
version()
Deprecated. getVersion() |
| Methods inherited from class edu.neu.ccs.demeter.aplib.cd.ClassGraph |
__trav_convertRepetition, __trav_expandParamDefs, __trav_removeParamDefs, __trav_setBackLinks, __trav_setInheritanceLinks, addAlternationEdge, addConstructionEdge, addEdge, addInheritanceEdge, allClassDefs, allParts, definesClass, fromString, get_classes, get_preamble, getIncomingEdges, getNode, getNodes, getOutgoingEdges, normalize, parse, parse, parse, printTraversalEdges, readFrom, readFrom, set_classes, set_preamble, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static boolean debug
protected Set packages
protected Map classesAdded
ClassGraph.definesClass(java.lang.String) will be true for classes we've added on
either end of an edge, but we want to keep track of edge sources
in particular.
protected Map namesClasses
| Constructor Detail |
public ClassGraph()
public ClassGraph(String pkg)
pkg,
including all non-static fields and non-static non-void no-argument
methods.
public ClassGraph(boolean f,
boolean m)
f is true, include all non-static fields;
if m is true, include all non-static non-void
no-argument methods. These settings will apply by default for all
classes added to the class graph in the future.
public ClassGraph(String pkg,
boolean f,
boolean m)
pkg.
If f is true, include all non-static fields;
if m is true, include all non-static non-void
no-argument methods. These settings will apply by default for all
classes added to the class graph in the future.
public ClassGraph(Traversal tg)
tg.
public ClassGraph(ClassGraph cg,
Strategy s)
throws TraversalException
cg
reachable by following s.
public ClassGraph(ClassGraph cg,
String s)
throws TraversalException
cg
reachable by following strategy s.
| Method Detail |
public static String getVersion()
public static String version()
public void addPackage(String p)
p that can be found on the
class path.
public void addClass(Class cl)
cl and all its non-static members to the class graph
as construction edges, if they haven't already been added.
public void addClass(Class cl,
boolean addFields,
boolean addMethods)
cl to the class graph, if it hasn't already been added.
If addFields is true, add all its non-static fields as
construction edges. If addMethods is true, add all its
non-static non-void methods with no arguments as derived construction
edges.
public Part addConstructionEdge(Field field)
public Part addConstructionEdge(Method method)
public Part addConstructionEdge(String source,
Field field)
public Part addConstructionEdge(String source,
Method method)
public Part addConstructionEdge(String source,
String label,
Class target)
public void addRepetitionEdge(String source,
String target)
public static boolean isRepetitionEdge(EdgeI edge)
public Class getNodeClass(Object node)
o.
public Class getClassNamed(String name)
name.
public ObjectGraphSlice slice(Object o,
Strategy s)
public ObjectGraphSlice slice(Object o,
String s)
public Object traverse(Object o,
Strategy s,
Visitor v)
public Object traverse(Object o,
Strategy s,
Visitor[] v)
public Object fetch(Object o,
Strategy s)
throws FetchException
FetchException
public List gather(Object o,
Strategy s)
public List asList(Object o,
Strategy s)
public Object traverse(Object o,
String s,
Visitor v)
public Object traverse(Object o,
String s,
Visitor[] v)
public Object fetch(Object o,
String s)
throws FetchException
FetchException
public List gather(Object o,
String s)
public List asList(Object o,
String s)
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||