| java.lang.Object EDU.purdue.cs.bloat.editor.ClassHierarchy
ClassHierarchy | public class ClassHierarchy (Code) | | ClassHierarchy maintains a graph of the subclass relationships of the classes
loaded by the ClassInfoLoader.
See Also: ClassInfoLoader |
Inner Class :class TypeNode extends GraphNode | |
Inner Class :public class ResolvesToWith | |
DEBUG | public static boolean DEBUG(Code) | | |
MAX_BOOL | final static int MAX_BOOL(Code) | | |
MAX_BYTE | final static int MAX_BYTE(Code) | | |
MAX_CHAR | final static int MAX_CHAR(Code) | | |
MAX_INT | final static int MAX_INT(Code) | | |
MAX_SHORT | final static int MAX_SHORT(Code) | | |
MIN_BOOL | final static int MIN_BOOL(Code) | | |
MIN_BYTE | final static int MIN_BYTE(Code) | | |
MIN_CHAR | final static int MIN_CHAR(Code) | | |
MIN_INT | final static int MIN_INT(Code) | | |
MIN_SHORT | final static int MIN_SHORT(Code) | | |
RELAX | public static boolean RELAX(Code) | | |
ZERO | final static int ZERO(Code) | | |
ClassHierarchy | public ClassHierarchy(EditorContext context, Collection initial, boolean closure)(Code) | | Constructor.
Parameters: context - The context in which to access an Editor and othersuch things. Parameters: initial - The names of the classes that initially constitue thehierarchy. Parameters: closure - Do we get the maximum amount of class information? |
addClassNamed | public void addClassNamed(String name)(Code) | | Adds a class of a given name to the ClassHierarchy.
|
classes | public Collection classes()(Code) | | Returns (the Types of) all of the classes and interfaces in
the hierarchy.
|
closure | public boolean closure()(Code) | | Returns true if class closure has been computed
|
implementors | public Collection implementors(Type type)(Code) | | Returns the classes (Types) that implement a given interface
as a Collection of Types.
See note in subclasses for information about the interface
hierarchy.
|
interfaces | public Collection interfaces(Type type)(Code) | | Returns the interfaces that a given Type implements as a
Collection of Types
|
intersectType | public Type intersectType(Type a, Type b)(Code) | | Returns the intersection of two types. Basically, the interstion of two
types is the type (if any) to which both types may be assigned. So, if a
is a subtype of b, a is returned. Otherwise, Type.NULL is
returned.
|
methodInvoked | public MemberRef methodInvoked(Type receiver, NameAndType method)(Code) | | Returns the MemberRef of the method that would be invoked if a
given method of a given type was invoked. Basically, dynamic dispatch is
simulated.
|
methodIsOverridden | public boolean methodIsOverridden(Type classType, NameAndType nat)(Code) | | Determines whether or not a class's method is overriden by any of its
subclasses.
|
printClasses | public void printClasses(PrintWriter out, int indent)(Code) | | Prints the class hierarchy (i.e. the "extends" hierarchy, interfaces may
extends other interfaces) to a PrintWriter.
|
printImplements | public void printImplements(PrintWriter out, int indent)(Code) | | Prints the implements hierarchy to a PrintWriter.
|
resolvesToWith | public Set resolvesToWith(MemberRef method)(Code) | | Returns a set of ResolvesToWith that represent all subclass
methods that override a given method and the subclasses that when used as
receivers resolve to that method.
See Also: ResolvesToWith |
setToType | public static Type setToType(BitSet v)(Code) | | Given a set of bits representing the range of values some type has,
determines what that Type is.
|
subclassOf | public boolean subclassOf(Type a, Type b)(Code) | | Returns whether or not a is a subclass of b.
|
subclasses | public Collection subclasses(Type type)(Code) | | Returns the immediate subclasses of a given Type as a
Collection of Types.
The subclass relationship at the classfile level is a little screwy with
respect to interfaces. An interface that extends another interface is
compiled into an interface that extends java.lang.Object and implements
the superinterface. As a result, the interface-subinterface is not
captured in subclasses as one may expect. Instead, you have to
look at implementors and filter out the classes.
|
superclass | public Type superclass(Type type)(Code) | | Returns the superclass of a given Type. If the Type
has no superclass (that is it is Type.OBJECT), then null is
returned.
|
typeToSet | public static BitSet typeToSet(Type type)(Code) | | Returns a BitSet representing the possible values of a given integral
type.
|
unionType | public Type unionType(Type a, Type b)(Code) | | Returns the union of two types. The union of two types is their most
refined common supertype. At worst, the union is Type.OBJECT
|
unionTypes | public Type unionTypes(Collection types)(Code) | | Returns the most refined common supertype for a bunch of Types.
|
|
|