Codota Logo
ITypeHierarchy.contains
Code IndexAdd Codota to your IDE (free)

How to use
contains
method
in
org.eclipse.jdt.core.ITypeHierarchy

Best Java code snippets using org.eclipse.jdt.core.ITypeHierarchy.contains (Showing top 20 results out of 315)

  • Common ways to obtain ITypeHierarchy
private void myMethod () {
ITypeHierarchy i =
  • Codota IconIType type;type.newSupertypeHierarchy(null)
  • Codota IconCreateTypeHierarchyOperation op;op.getResult()
  • Codota IconIType type;SuperTypeHierarchyCache.getTypeHierarchy(type)
  • Smart code suggestions by Codota
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private void processTypeDelta(IType type, ArrayList<IType> changedTypes) {
  if (getHierarchy().contains(type)) {
    changedTypes.add(type);
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private void processTypeDelta(IType type, ArrayList<IType> changedTypes) {
  if (getHierarchy().contains(type)) {
    changedTypes.add(type);
  }
}
origin: org.eclipse/org.eclipse.jdt.ui

private void processTypeDelta(IType type, ArrayList changedTypes) {
  if (getHierarchy().contains(type)) {
    changedTypes.add(type);
  }
}

origin: eclipse/eclipse.jdt.ls

static IType[] computeInheritancePath(IType subType, IType superType) throws JavaModelException {
  if (superType == null) {
    return null;
  }
  // optimization: avoid building the type hierarchy for the identity case
  if (superType.equals(subType)) {
    return new IType[] { subType };
  }
  ITypeHierarchy hierarchy= subType.newSupertypeHierarchy(new NullProgressMonitor());
  if (!hierarchy.contains(superType))
  {
    return null; // no path
  }
  List<IType> path= new LinkedList<>();
  path.add(superType);
  do {
    // any sub type must be on a hierarchy chain from superType to subType
    superType= hierarchy.getSubtypes(superType)[0];
    path.add(superType);
  } while (!superType.equals(subType)); // since the equality case is handled above, we can spare one check
  return path.toArray(new IType[path.size()]);
}
origin: org.eclipse/org.eclipse.jdt.ui

public boolean visit(FieldAccess node) {
  final ITypeBinding declaring= MoveInnerToTopRefactoring.getDeclaringTypeBinding(node);
  if (declaring != null) {
    final IType type= (IType) declaring.getJavaElement();
    if (type != null && fHierarchy.contains(type))
      fFieldAccesses.add(node);
  }
  return super.visit(node);
}
origin: org.eclipse/org.eclipse.jdt.ui

public boolean visit(MethodInvocation node) {
  final ITypeBinding declaring= MoveInnerToTopRefactoring.getDeclaringTypeBinding(node);
  if (declaring != null) {
    final IType type= (IType) declaring.getJavaElement();
    if (type != null && fHierarchy.contains(type))
      fMethodAccesses.add(node);
  }
  return super.visit(node);
}
origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e

private static IType findMostSpecific(Collection<IType> candidates) throws JavaModelException {
 ITypeHierarchy superHierarchy = null;
 for (IType t : candidates) {
  if (superHierarchy == null || !superHierarchy.contains(t)) {
   superHierarchy = t.newSupertypeHierarchy(null);
  }
 }
 if (superHierarchy == null) {
  return null;
 }
 return superHierarchy.getType();
}
origin: eclipse/eclipse.jdt.ls

private ITypeHierarchy getCachedHierarchy(IType type, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
  IType rep = fUnionFind.find(type);
  if (rep != null) {
    Collection<IType> collection = fRootReps.get(rep);
    for (Iterator<IType> iter = collection.iterator(); iter.hasNext();) {
      IType root = iter.next();
      ITypeHierarchy hierarchy = fRootHierarchies.get(root);
      if (hierarchy == null) {
        hierarchy = root.newTypeHierarchy(owner, new SubProgressMonitor(monitor, 1));
        fRootHierarchies.put(root, hierarchy);
      }
      if (hierarchy.contains(type)) {
        return hierarchy;
      }
    }
  }
  return null;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private ITypeHierarchy getCachedHierarchy(IType type, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
  IType rep= fUnionFind.find(type);
  if (rep != null) {
    Collection<IType> collection= fRootReps.get(rep);
    for (Iterator<IType> iter= collection.iterator(); iter.hasNext();) {
      IType root= iter.next();
      ITypeHierarchy hierarchy= fRootHierarchies.get(root);
      if (hierarchy == null) {
        hierarchy= root.newTypeHierarchy(owner, new SubProgressMonitor(monitor, 1));
        fRootHierarchies.put(root, hierarchy);
      }
      if (hierarchy.contains(type))
        return hierarchy;
    }
  }
  return null;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private ITypeHierarchy getCachedHierarchy(IType type, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
  IType rep= fUnionFind.find(type);
  if (rep != null) {
    Collection<IType> collection= fRootReps.get(rep);
    for (Iterator<IType> iter= collection.iterator(); iter.hasNext();) {
      IType root= iter.next();
      ITypeHierarchy hierarchy= fRootHierarchies.get(root);
      if (hierarchy == null) {
        hierarchy= root.newTypeHierarchy(owner, new SubProgressMonitor(monitor, 1));
        fRootHierarchies.put(root, hierarchy);
      }
      if (hierarchy.contains(type))
        return hierarchy;
    }
  }
  return null;
}
origin: org.eclipse/org.eclipse.jdt.ui

private ITypeHierarchy getCachedHierarchy(IType type, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
  IType rep= fUnionFind.find(type);
  if (rep != null) {
    Collection collection= fRootReps.get(rep);
    for (Iterator iter= collection.iterator(); iter.hasNext();) {
      IType root= (IType) iter.next();
      ITypeHierarchy hierarchy= (ITypeHierarchy) fRootHierarchies.get(root);
      if (hierarchy == null) {
        hierarchy= root.newTypeHierarchy(owner, new SubProgressMonitor(monitor, 1));
        fRootHierarchies.put(root, hierarchy);
      }
      if (hierarchy.contains(type))
        return hierarchy;
    }
  }
  return null;
}
origin: eclipse/eclipse.jdt.ls

private ITypeHierarchy getCachedHierarchy(IType type, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
  IType rep= fUnionFind.find(type);
  if (rep != null) {
    Collection<IType> collection= fRootReps.get(rep);
    for (Iterator<IType> iter= collection.iterator(); iter.hasNext();) {
      IType root= iter.next();
      ITypeHierarchy hierarchy= fRootHierarchies.get(root);
      if (hierarchy == null) {
        hierarchy= root.newTypeHierarchy(owner, new SubProgressMonitor(monitor, 1));
        fRootHierarchies.put(root, hierarchy);
      }
      if (hierarchy.contains(type)) {
        return hierarchy;
      }
    }
  }
  return null;
}
origin: org.eclipse/org.eclipse.jdt.ui

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

origin: org.eclipse.jdt/org.eclipse.jdt.core.manipulation

private static ITypeHierarchy findTypeHierarchyInCache(IType type) {
  synchronized (fgHierarchyCache) {
    for (int i= fgHierarchyCache.size() - 1; i>= 0; i--) {
      HierarchyCacheEntry curr= fgHierarchyCache.get(i);
      ITypeHierarchy hierarchy= curr.getTypeHierarchy();
      if (!hierarchy.exists()) {
        removeHierarchyEntryFromCache(curr);
      } else {
        if (hierarchy.contains(type)) {
          curr.markAsAccessed();
          return hierarchy;
        }
      }
    }
  }
  return null;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private static ITypeHierarchy findTypeHierarchyInCache(IType type) {
  synchronized (fgHierarchyCache) {
    for (int i= fgHierarchyCache.size() - 1; i>= 0; i--) {
      HierarchyCacheEntry curr= fgHierarchyCache.get(i);
      ITypeHierarchy hierarchy= curr.getTypeHierarchy();
      if (!hierarchy.exists()) {
        removeHierarchyEntryFromCache(curr);
      } else {
        if (hierarchy.contains(type)) {
          curr.markAsAccessed();
          return hierarchy;
        }
      }
    }
  }
  return null;
}
origin: org.eclipse/org.eclipse.jdt.ui

  public boolean visit(ThisExpression node) {
    final Name qualifier= node.getQualifier();
    if (qualifier != null) {
      final ITypeBinding binding= qualifier.resolveTypeBinding();
      if (binding != null) {
        final IType type= (IType) binding.getJavaElement();
        if (type != null && fHierarchy.contains(type)) {
          fSimpleNames.add(qualifier);
          return false;
        }
      }
    }
    return super.visit(node);
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private static boolean isEclipseNLSUsed(IType accessor) {
  IJavaProject javaProject= accessor.getJavaProject();
  if (javaProject == null || !javaProject.exists())
    return false;
  try {
    IType nls= javaProject.findType("org.eclipse.osgi.util.NLS"); //$NON-NLS-1$
    if(nls==null)
      return false;
    ITypeHierarchy supertypeHierarchy= accessor.newSupertypeHierarchy(null);
    return supertypeHierarchy.contains(nls);
  } catch (JavaModelException e) {
    return false;
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private static boolean isEclipseNLSUsed(IType accessor) {
  IJavaProject javaProject= accessor.getJavaProject();
  if (javaProject == null || !javaProject.exists())
    return false;
  try {
    IType nls= javaProject.findType("org.eclipse.osgi.util.NLS"); //$NON-NLS-1$
    if(nls==null)
      return false;
    ITypeHierarchy supertypeHierarchy= accessor.newSupertypeHierarchy(null);
    return supertypeHierarchy.contains(nls);
  } catch (JavaModelException e) {
    return false;
  }
}
origin: io.sarl/io.sarl.eclipse

  @SuppressWarnings("synthetic-access")
  @Override
  public void run(IProgressMonitor pm) throws InvocationTargetException {
    try {
      final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
      final IJavaProject javaProject = JavaCore.create(project);
      final IType agentType = javaProject.findType("io.sarl.lang.core.Agent"); //$NON-NLS-1$
      if (agentType != null) {
        final IType type = javaProject.findType(agentName);
        if (type != null) {
          res[0] = type.newSupertypeHierarchy(pm).contains(agentType);
        }
      }
    } catch (JavaModelException e) {
      setErrorMessage(e.getLocalizedMessage());
      JDIDebugUIPlugin.log(e);
    }
  }
});
origin: org.eclipse/org.eclipse.jdt.ui

public boolean visit(SimpleName node) {
  if (node.getParent() instanceof QualifiedName)
    return super.visit(node);
  IBinding binding= node.resolveBinding();
  if (binding instanceof IVariableBinding) {
    IVariableBinding variable= (IVariableBinding) binding;
    ITypeBinding declaring= variable.getDeclaringClass();
    if (variable.isField() && declaring != null) {
      final IType type= (IType) declaring.getJavaElement();
      if (type != null && fHierarchy.contains(type)) {
        fSimpleNames.add(node);
        return false;
      }
    }
  }
  return super.visit(node);
}
org.eclipse.jdt.coreITypeHierarchycontains

Javadoc

Returns whether the given type is part of this hierarchy.

Popular methods of ITypeHierarchy

  • getAllSubtypes
    Returns all resolved subtypes (direct and indirect) of the given type, in no particular order, limit
  • getAllSupertypes
    Returns all resolved supertypes of the given type, in bottom-up order. An empty array is returned if
  • getAllClasses
    Returns all classes in this type hierarchy's graph, in no particular order. Any classes in the creat
  • getAllTypes
    Returns all types in this type hierarchy's graph, in no particular order. Any types in the creation
  • getSuperclass
    Returns the resolved superclass of the given class, or null if the given class has no superclass, th
  • getAllSuperclasses
    Returns all resolved superclasses of the given class, in bottom-up order. An empty array is returned
  • refresh
    Re-computes the type hierarchy reporting progress.
  • getCachedFlags
    Return the flags associated with the given type (would be equivalent to IMember.getFlags()), or -1
  • getSubclasses
    Returns the direct resolved subclasses of the given class, in no particular order, limited to the cl
  • getSubtypes
    Returns the direct resolved subtypes of the given type, in no particular order, limited to the types
  • getSuperInterfaces
    Returns the direct resolved interfaces that the given type implements or extends, in no particular o
  • getType
    Returns the type this hierarchy was computed for. Returns null if this hierarchy was computed for a
  • getSuperInterfaces,
  • getType,
  • getAllInterfaces,
  • getAllSuperInterfaces,
  • addTypeHierarchyChangedListener,
  • exists,
  • getImplementingClasses,
  • getSupertypes,
  • removeTypeHierarchyChangedListener

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now