|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.ClassHierarchy
harpoon.Analysis.Quads.QuadClassHierarchy
public class QuadClassHierarchy
QuadClassHierarchy
computes a ClassHierarchy
of classes possibly usable starting from some root method using
quad form.
Native methods are not analyzed.
Constructor Summary | |
---|---|
QuadClassHierarchy(Linker linker,
Collection roots,
HCodeFactory hcf)
Creates a ClassHierarchy of all classes
reachable/usable from HMethod s in the roots
Collection . |
Method Summary | |
---|---|
Set<HMethod> |
callableMethods()
Returns set of all callable methods. |
Set<HClass> |
children(HClass c)
Returns the set of all usable/reachable children of an HClass . |
Set<HClass> |
classes()
Returns the set of all reachable/usable classes. |
Set<HClass> |
instantiatedClasses()
Returns the set of all classes instantiated. |
String |
toString()
Returns a human-readable representation of the hierarchy. |
Methods inherited from class harpoon.Analysis.ClassHierarchy |
---|
overrides, overrides |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public QuadClassHierarchy(Linker linker, Collection roots, HCodeFactory hcf)
ClassHierarchy
of all classes
reachable/usable from HMethod
s in the roots
Collection
. HClass
es included in
roots
are guaranteed to be included in the
classes()
set of this class hierarchy, but they may
not be included in the instantiatedClasses
set
(if an instantiation instruction is not found for them). To
explicitly include an instantiated class in the hierarchy, add
a constructor or non-static method of that class to the
roots
Collection
. hcf
must be a code factory that generates quad form.
Method Detail |
---|
public Set<HMethod> callableMethods()
callableMethods
in class ClassHierarchy
Set
of HMethod
s.public Set<HClass> children(HClass c)
ClassHierarchy
HClass
. For an interface class c
,
the children include all reachable classes which implement it
as well as any reachable interfaces which extend it. For a
non-interface class, children are all reachable subclasses.
Note: this method deals with direct children; i.e., it doesn't
return transitive (more than one level) subclassing children.
The result should be complementary to the result of the
c.parents()
method: the parents of any class
c
returned by children(cc)
should
include cc
.
children
in class ClassHierarchy
public Set<HClass> classes()
ClassHierarchy
More technically, this method returns the smallest set C that satisfies the following rules:
ClassHierarchy.callableMethods()
). This includes:
classes()
includes the set returned by
instantiatedClasses()
).
instanceof
tests (including the implicit tests
that appear at the beginning of exception handlers).
T[]>
appears in C, T
appears in C too.
.c
file for its declaring
class, including the code for that static method (but not
including the code for other method that are not invoked by
the compiled application).
classes
in class ClassHierarchy
public Set<HClass> instantiatedClasses()
instantiatedClasses
in class ClassHierarchy
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |