Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.ITypeHierarchy


        // accessed
        HierarchyCacheEntry oldest = null;
        List<HierarchyCacheEntry> obsoleteHierarchies = new ArrayList<HierarchyCacheEntry>(CACHE_SIZE);
        for (int i = 0; i < nEntries; i++) {
          HierarchyCacheEntry entry = (HierarchyCacheEntry) HIERACHY_CACHE.get(i);
          ITypeHierarchy curr = entry.getTypeHierarchy();
          if (!curr.exists() || hierarchy.contains(curr.getType())) {
            obsoleteHierarchies.add(entry);
          }
          else {
            if (oldest == null || entry.getLastAccess() < oldest.getLastAccess()) {
              oldest = entry;
View Full Code Here


  private static ITypeHierarchy findTypeHierarchyInCache(IType type) {
    synchronized (HIERACHY_CACHE) {
      for (int i = HIERACHY_CACHE.size() - 1; i >= 0; i--) {
        HierarchyCacheEntry curr = (HierarchyCacheEntry) HIERACHY_CACHE.get(i);
        ITypeHierarchy hierarchy = curr.getTypeHierarchy();
        if (!hierarchy.exists()) {
          removeHierarchyEntryFromCache(curr);
        }
        else {
          if (hierarchy.contains(type)) {
            curr.markAsAccessed();
            return hierarchy;
          }
        }
      }
View Full Code Here

   * @param progressMonitor a {@link IProgressMonitor} instance to report progress
   * @return the {@link ITypeHierarchy} for the given <code>type</code>
   */
  public static ITypeHierarchy getTypeHierarchy(IType type, IProgressMonitor progressMonitor)
      throws JavaModelException {
    ITypeHierarchy hierarchy = findTypeHierarchyInCache(type);
    if (hierarchy == null) {
      hierarchy = type.newTypeHierarchy(progressMonitor);
      addTypeHierarchyToCache(hierarchy);
    }
    return hierarchy;
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.ITypeHierarchy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.