/** * Check if the given type is in the hierarchy cache. * @param type a type * @return <code>true</code> if a hierarchy for the given type is cached */ public static boolean hasInCache(IType type) { return findTypeHierarchyInCache(type) != null; }
/** * Check if the given type is in the hierarchy cache. * @param type a type * @return <code>true</code> if a hierarchy for the given type is cached */ public static boolean hasInCache(IType type) { return findTypeHierarchyInCache(type) != null; }
/** * Check if the given type is in the hierarchy * @param type * @return Return <code>true</code> if a hierarchy for the given type is cached. */ public static boolean hasInCache(IType type) { return findTypeHierarchyInCache(type) != null; }
/** * Get a hierarchy for the given type */ public static ITypeHierarchy getTypeHierarchy(IType type, IProgressMonitor progressMonitor) throws JavaModelException { ITypeHierarchy hierarchy= findTypeHierarchyInCache(type); if (hierarchy == null) { fgCacheMisses++; hierarchy= type.newSupertypeHierarchy(progressMonitor); addTypeHierarchyToCache(hierarchy); } else { fgCacheHits++; } return hierarchy; }
/** * Returns a super type hierarchy that contains the given type. * The returned hierarchy may actually be based on a subtype of the * requested type. Therefore, queries such as {@link ITypeHierarchy#getAllClasses()} * or {@link ITypeHierarchy#getRootInterfaces()} may return more types than the same * queries on a type hierarchy for just the given type. * * @param type the focus type * @param progressMonitor progress monitor * @return a supertype hierarchy that contains <code>type</code> * @throws JavaModelException if a problem occurs */ public static ITypeHierarchy getTypeHierarchy(IType type, IProgressMonitor progressMonitor) throws JavaModelException { ITypeHierarchy hierarchy= findTypeHierarchyInCache(type); if (hierarchy == null) { fgCacheMisses++; hierarchy= type.newSupertypeHierarchy(progressMonitor); addTypeHierarchyToCache(hierarchy); } else { fgCacheHits++; } return hierarchy; }
/** * Returns a super type hierarchy that contains the given type. * The returned hierarchy may actually be based on a subtype of the * requested type. Therefore, queries such as {@link ITypeHierarchy#getAllClasses()} * or {@link ITypeHierarchy#getRootInterfaces()} may return more types than the same * queries on a type hierarchy for just the given type. * * @param type the focus type * @param progressMonitor progress monitor * @return a supertype hierarchy that contains <code>type</code> * @throws JavaModelException if a problem occurs */ public static ITypeHierarchy getTypeHierarchy(IType type, IProgressMonitor progressMonitor) throws JavaModelException { ITypeHierarchy hierarchy= findTypeHierarchyInCache(type); if (hierarchy == null) { fgCacheMisses++; hierarchy= type.newSupertypeHierarchy(progressMonitor); addTypeHierarchyToCache(hierarchy); } else { fgCacheHits++; } return hierarchy; }