Add an XClass and all of its supertypes to the InheritanceGraph.

@param xclass
an XClass
@return the ClassVertex representing the class in the InheritanceGraph
974784
private ClassVertex addClassAndGetClassVertex(XClass xclass) {
        if (xclass == null) {
            throw new IllegalStateException();
        }

        LinkedList<XClass> workList = new LinkedList<>();
        workList.add(xclass);

        while (!workList.isEmpty()) {
            XClass work = workList.removeFirst();
            ClassVertex vertex = classDescriptorToVertexMap.get(work.getClassDescriptor());
            if (vertex != null && vertex.isFinished()) {
                // This class has already been processed.
                continue;
            }

            if (vertex == null) {
                vertex = ClassVertex.createResolvedClassVertex(work.getClassDescriptor(), work);
                addVertexToGraph(work.getClassDescriptor(), vertex);
            }

            addSupertypeEdges(vertex, workList);

            vertex.setFinished(true);
        }

        return classDescriptorToVertexMap.get(xclass.getClassDescriptor());
    }
1074018
public <B extends ImageGray<B>> B createSameShape( Class<B> type )
	{
		return GeneralizedImageOps.createSingleBand(type,width,height);
	}
713360
public void addVertex(final AbstractJobInputVertex inputVertex) {

		if (!inputVertices.containsKey(inputVertex.getID())) {
			inputVertices.put(inputVertex.getID(), inputVertex);
		}
	}
1102369
public SortedSet<TypeElement> implementingClasses(TypeElement typeElement) {
        SortedSet<TypeElement> result = get(implementingClasses, typeElement);
        SortedSet<TypeElement> intfcs = allSubClasses(typeElement, false);

        // If class x implements a subinterface of typeElement, then it follows
        // that class x implements typeElement.
        Iterator<TypeElement> subInterfacesIter = intfcs.iterator();
        while (subInterfacesIter.hasNext()) {
            Iterator<TypeElement> implementingClassesIter
                    = implementingClasses(subInterfacesIter.next()).iterator();
            while (implementingClassesIter.hasNext()) {
                TypeElement c = implementingClassesIter.next();
                if (!result.contains(c)) {
                    result.add(c);
                }
            }
        }
        return result;
    }
1081515
public VertexElement addVertexElement(Schema.BaseType baseType) {
        Vertex vertex = graph.addVertex(baseType.name());
        return new VertexElement(tx, vertex);
    }
338498
public XML addClass(Class<?> aClass, Global global){
		checksClassAbsence(aClass);
		
		XmlClass xmlClass = new XmlClass();
		xmlClass.name = aClass.getName();
		xmlJmapper.classes.add(xmlClass);
		addGlobal(aClass, global);
		return this;
	}
721034
@Nonnull
  @CodingStyleguideUnaware
  public JSDefinedClass _extends (@Nonnull final AbstractJSClass aSuperClass)
  {
    m_aSuperClass = ValueEnforcer.notNull (aSuperClass, "SuperClass");
    return this;
  }
910311
public static Set<Class<?>> getAllSuperTypes(final Class<?> cls) {
        final Set<Class<?>> superTypesFound = new LinkedHashSet<>();

        getAllSuperTypes(cls, superTypesFound);

        return superTypesFound;
    }
1193730
private ClassDescriptorDef ensureClassDef(XClass original)
    {
        String             name     = original.getQualifiedName();
        ClassDescriptorDef classDef = _model.getClass(name);

        if (classDef == null)
        {
            classDef = new ClassDescriptorDef(original);
            _model.addClass(classDef);
        }
        return classDef;
    }
977973
@Nonnull
    public BugInstance addClass(ClassNode classNode) {
        String dottedClassName = ClassName.toDottedClassName(classNode.name);
        ClassAnnotation classAnnotation = new ClassAnnotation(dottedClassName);
        add(classAnnotation);
        return this;
    }
57204
@Override
    public boolean visitClass(ClassDescriptor classDescriptor, XClass xclass) {
        assert xclass != null;
        String methodSignature = xmethod.getSignature();
        XMethod bridgedFrom = xmethod.bridgeFrom();
        // See if this class has an overridden method

        XMethod xm = xclass.findMethod(xmethod.getName(), methodSignature, false);

        if (xm == null && bridgedFrom != null && !classDescriptor.equals(xmethod.getClassDescriptor())) {
            methodSignature = bridgedFrom.getSignature();
            xm = xclass.findMethod(xmethod.getName(), methodSignature, false);
        }

        if (xm != null) {
            return visitOverriddenMethod(xm) || bridgedFrom != null;
        } else {
            // Even though this particular class doesn't contain the method
            // we're
            // looking for, a superclass might, so we need to keep going.
            return true;
        }
    }
519150
@SuppressWarnings("unchecked")
	@Override
	public Class<SortedMap<K, V>> getTypeClass() {
		return (Class<SortedMap<K, V>>) (Class<?>) SortedMap.class;
	}
840309
public Class<? extends org.eclipse.xtext.IGrammarAccess> bindIGrammarAccess() {
		return org.eclipse.xtext.xtext.generator.parser.antlr.splitting.services.SimpleExpressionsGrammarAccess.class;
	}
819644
public List<Class<?>> directSuperclasses(Class<?> c)
    {
        if(c.isPrimitive()) {
            return primitiveSuperclasses(c);
        }
        else if(c.isArray()) {
            return arrayDirectSuperclasses(0, c);
        }
        else {
            Class<?> [] interfaces = c.getInterfaces();
            Class<?> superclass = c.getSuperclass();

            List<Class<?>> classes = new LinkedList<Class<?>>();
            classes.addAll(Arrays.asList(interfaces));
            if(superclass == null) {
                if(interfaces.length == 0 &&
                   c != Object.class)
                    classes.add(Object.class);
            }
            else {
                classes.add(superclass);
            }

            return classes;
        }
    }
759461
public static List<Class<?>> getAllSuperclasses(final Class<?> cls) {
        if (cls == null) {
            return null;
        }
        final List<Class<?>> classes = new ArrayList<>();
        Class<?> superclass = cls.getSuperclass();
        while (superclass != null) {
            classes.add(superclass);
            superclass = superclass.getSuperclass();
        }
        return classes;
    }
160280
private void addSuperClasses(Integer directSuperClass,
			ClassRecord subClassRecord) {
		if (subClassRecord.superClasses.contains(directSuperClass)) {
			return;
		}
		subClassRecord.superClasses.add(directSuperClass);
		ClassRecord superClassRecord = getClassRecord(directSuperClass);
		if (superClassRecord == null) {
			return;
		}

		for (Integer superClass : superClassRecord.directSuperClasses) {
			addSuperClasses(superClass, subClassRecord);
		}
	}
862023
private OClass addBaseClasses(final OClass iBaseClass) {
    if (baseClasses == null)
      baseClasses = new ArrayList<OClass>();

    if (baseClasses.contains(iBaseClass))
      return this;

    baseClasses.add(iBaseClass);

    // ADD CLUSTER IDS OF BASE CLASS TO THIS CLASS AND ALL SUPER-CLASSES
    OClassImpl currentClass = this;
    while (currentClass != null) {
      currentClass.addPolymorphicClusterIds((OClassImpl) iBaseClass);
      currentClass = (OClassImpl) currentClass.getSuperClass();
    }

    return this;
  }