|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.ClassHierarchy
public abstract class ClassHierarchy
A ClassHierarchy
enumerates reachable/usable classes
and callable methods. A method is callable if the execution
of the compiled application may invoke that method (see callableMethods()
for more info); these are the methods that Flex
absolutely has to compile. To understand which classes are
reachable/usable, please see classes()
.
Constructor Summary | |
---|---|
ClassHierarchy()
|
Method Summary | |
---|---|
abstract Set<HMethod> |
callableMethods()
Returns the set of all callable methods. |
abstract Set<HClass> |
children(HClass c)
Returns the set of all usable/reachable children of an HClass . |
abstract Set<HClass> |
classes()
Returns the set of all reachable/usable classes. |
abstract Set<HClass> |
instantiatedClasses()
Returns the set of all instantiated classes. |
Set<HMethod> |
overrides(HClass hc,
HMethod hm,
boolean all)
Returns the set of methods, excluding hm , declared
in classes which are instances of hc , which override
hm . |
Set<HMethod> |
overrides(HMethod hm)
Returns a set of methods in the hierarchy (not necessary reachable methods) which override the given method hm . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassHierarchy()
Method Detail |
---|
public abstract Set<HClass> children(HClass c)
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
.
public final Set<HMethod> overrides(HMethod hm)
hm
. The set does not include hm
and
is only one level deep; invoke overrides()
again
on each member of the returned set to find the rest of the
possible overriding methods.
Note however that interface methods may introduce some
imprecision: in particular, for some hm2 in overrides(hm1)
(where hm1 is an interface method), hm2.getDeclaringClass()
may not implement the interface hm1.getDeclaringClass(). For
example, ListIterator.next()
may be implemented
by class A
that does not implement the full
ListIterator
interface; class B
(a
subclass of A
which does not override
A.next()
) may be the class which implements
ListIterator
.
public Set<HMethod> overrides(HClass hc, HMethod hm, boolean all)
hm
, declared
in classes which are instances of hc
, which override
hm
. If all
is true, returns all such
methods in the class hierarchy; otherwise returns only the methods
which *immediately* override hm
.
public abstract Set<HMethod> callableMethods()
m
is callable iff
m
is the main
method of the application.
m
is invoked by the runtime code before the
start of the main method (there may be such calls in order to
initialize some required classes).
m
is the class initializer of a class from
the set returned by the classes()
method; these
classes are referenced, i.e., used, by the compiled
application, so their class initializers ARE executed.
m
is the run
method of a thread
that is started by an already callable method.
m
is invoked from the an already callable method.
public abstract Set<HClass> classes()
More technically, this method returns the smallest set C that satisfies the following rules:
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).
public abstract Set<HClass> instantiatedClasses()
classes()
method. It includes:
callableMethods()
), using an instruction
like NEW
or ANEW
(array new).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |