Class RegionBasedTypeHierarchy
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy
org.aspectj.org.eclipse.jdt.internal.core.hierarchy.RegionBasedTypeHierarchy
- All Implemented Interfaces:
IElementChangedListener, ITypeHierarchy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IRegionThe region of types for which to build the hierarchyFields inherited from class TypeHierarchy
changeCollector, changeListeners, classToSuperclass, computeSubtypes, DEBUG, files, focusType, interfaces, missingTypes, needsRefresh, NO_TYPE, packageRegion, progressMonitor, project, projectRegion, rootClasses, typeFlags, typeToSubtypes, typeToSuperInterfaces, workingCopiesModifier and TypeFieldDescriptionprotected ChangeCollectorprotected ArrayList<ITypeHierarchyChangedListener> Change listeners - null if no one is listening.protected booleanWhether this hierarchy should contains subtypes.static booleanprotected ITypeThe type the hierarchy was specifically computed for, possibly null.booleanprotected static final IType[]protected RegionA region describing the packages considered by this hierarchy.protected org.eclipse.core.runtime.SubMonitorThe progress monitor to report work completed too.protected IJavaProjectThe Java Project in which the hierarchy is being built - this provides the context for determining a classpath and namelookup rules.protected RegionA region describing the projects considered by this hierarchy.protected ICompilationUnit[] -
Constructor Summary
ConstructorsConstructorDescriptionRegionBasedTypeHierarchy(IRegion region, ICompilationUnit[] workingCopies, IType type, boolean computeSubtypes) Creates a TypeHierarchy on the types in the specified region, considering first the given working copies, using the projects in the given region for a name lookup context. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcompute()Compute this type hierarchy.protected voidInitializes the file, package and project regionsprotected booleanisAffectedByOpenable(IJavaElementDelta delta, IJavaElement element, int eventType) Returns true if the given type delta (a compilation unit delta or a class file delta) could affect this type hierarchy.Returns the java project this hierarchy was created in.voidprotected voidremoveType(IType type) Removes all the subtypes of the given type from the type hierarchy, removes its superclass entry and removes the references from its super types.Methods inherited from class TypeHierarchy
addInterface, addRootClass, addSubtype, addTypeHierarchyChangedListener, cacheFlags, cacheSuperclass, cacheSuperInterfaces, checkCanceled, contains, elementChanged, exists, fireChange, getAllClasses, getAllInterfaces, getAllSubtypes, getAllSuperclasses, getAllSuperInterfaces, getAllSupertypes, getAllTypes, getCachedFlags, getExtendingInterfaces, getImplementingClasses, getRootClasses, getRootInterfaces, getSubclasses, getSubtypes, getSuperclass, getSuperInterfaces, getSupertypes, getType, growAndAddToArray, growAndAddToArray, hasFineGrainChanges, initialize, isAffected, load, packageRegionContainsSamePackageFragment, readUntil, readUntil, refresh, removeTypeHierarchyChangedListener, store, toString, workedModifier and TypeMethodDescriptionprotected voidaddInterface(IType type) Adds the type to the collection of interfaces.protected voidaddRootClass(IType type) Adds the type to the collection of root classes if the classes is not already present in the collection.protected voidaddSubtype(IType type, IType subtype) Adds the given subtype to the type.voidAdds the given listener for changes to this type hierarchy.voidcacheFlags(IType type, int flags) cacheFlags.protected voidcacheSuperclass(IType type, IType superclass) Caches the handle of the superclass for the specified type.protected voidcacheSuperInterfaces(IType type, IType[] superinterfaces) Caches all of the superinterfaces that are specified for the type.protected voidChecks with the progress monitor to see whether the creation of the type hierarchy should be canceled.booleanReturns whether the given type is part of this hierarchy.voidDetermines if the change affects this hierarchy, and fires change notification if required.booleanexists()Returns whether the type and project this hierarchy was created on exist.voidNotifies listeners that this hierarchy has changed and needs refreshing.IType[]Returns all classes in this type hierarchy's graph, in no particular order.IType[]Returns all interfaces in this type hierarchy's graph, in no particular order.IType[]getAllSubtypes(IType type) Returns all resolved subtypes (direct and indirect) of the given type, in no particular order, limited to the types in this type hierarchy's graph.IType[]getAllSuperclasses(IType type) Returns all resolved superclasses of the given class, in bottom-up order.IType[]getAllSuperInterfaces(IType type) Returns all resolved superinterfaces (direct and indirect) of the given type.IType[]getAllSupertypes(IType type) Returns all resolved supertypes of the given type, in bottom-up order.IType[]Returns all types in this type hierarchy's graph, in no particular order.intgetCachedFlags(IType type) Return the flags associated with the given type (would be equivalent toIMember.getFlags()), or-1if this information wasn't cached on the hierarchy during its computation.IType[]getExtendingInterfaces(IType type) Returns all interfaces resolved to extend the given interface, in no particular order, limited to the interfaces in this hierarchy's graph.IType[]getImplementingClasses(IType type) Returns all classes resolved to implement the given interface, in no particular order, limited to the classes in this type hierarchy's graph.IType[]Returns all classes in the graph which have no resolved superclass, in no particular order.IType[]Returns all interfaces in the graph which have no resolved superinterfaces, in no particular order.IType[]getSubclasses(IType type) Returns the direct resolved subclasses of the given class, in no particular order, limited to the classes in this type hierarchy's graph.IType[]getSubtypes(IType type) Returns the direct resolved subtypes of the given type, in no particular order, limited to the types in this type hierarchy's graph.getSuperclass(IType type) Returns the resolved superclass of the given class, ornullif the given class has no superclass, the superclass could not be resolved, or if the given type is an interface.IType[]getSuperInterfaces(IType type) Returns the direct resolved interfaces that the given type implements or extends, in no particular order, limited to the interfaces in this type hierarchy's graph.IType[]getSupertypes(IType type) Returns the resolved supertypes of the given type, in no particular order, limited to the types in this type hierarchy's graph.getType()Returns the type this hierarchy was computed for.protected IType[]growAndAddToArray(IType[] array, IType addition) Adds the new element to a new array that contains all of the elements of the old array.protected IType[]growAndAddToArray(IType[] array, IType[] additions) Adds the new elements to a new array that contains all of the elements of the old array.booleanprotected voidinitialize(int size) Initializes this hierarchy's internal tables with the given size.booleanisAffected(IJavaElementDelta delta, int eventType) Returns true if the given delta could change this type hierarchystatic ITypeHierarchyload(IType type, InputStream input, WorkingCopyOwner owner) protected booleanReturnstrueif an equivalent package fragment is included in the package region.protected static byte[]readUntil(InputStream input, byte separator) protected static byte[]readUntil(InputStream input, byte separator, int offset) voidrefresh(org.eclipse.core.runtime.IProgressMonitor monitor) Re-computes the type hierarchy reporting progress.voidRemoves the given listener from this type hierarchy.voidstore(OutputStream output, org.eclipse.core.runtime.IProgressMonitor monitor) Stores the type hierarchy in an output stream.toString()protected voidworked(int work)
-
Field Details
-
region
The region of types for which to build the hierarchy
-
-
Constructor Details
-
RegionBasedTypeHierarchy
public RegionBasedTypeHierarchy(IRegion region, ICompilationUnit[] workingCopies, IType type, boolean computeSubtypes) Creates a TypeHierarchy on the types in the specified region, considering first the given working copies, using the projects in the given region for a name lookup context. If a specific type is also specified, the type hierarchy is pruned to only contain the branch including the specified type.
-
-
Method Details
-
initializeRegions
protected void initializeRegions()Description copied from class:TypeHierarchyInitializes the file, package and project regions- Overrides:
initializeRegionsin classTypeHierarchy
-
compute
Compute this type hierarchy.- Overrides:
computein classTypeHierarchy- Throws:
JavaModelExceptionorg.eclipse.core.runtime.CoreException
-
isAffectedByOpenable
protected boolean isAffectedByOpenable(IJavaElementDelta delta, IJavaElement element, int eventType) Description copied from class:TypeHierarchyReturns true if the given type delta (a compilation unit delta or a class file delta) could affect this type hierarchy.- Overrides:
isAffectedByOpenablein classTypeHierarchy- Parameters:
eventType- TODO
-
javaProject
Returns the java project this hierarchy was created in.- Overrides:
javaProjectin classTypeHierarchy
-
pruneDeadBranches
public void pruneDeadBranches() -
removeType
Removes all the subtypes of the given type from the type hierarchy, removes its superclass entry and removes the references from its super types.
-