private Collection<TypeElement> implementingClasses(TypeElement te) {
        Collection<TypeElement> ret = classToImplementingClass.get(te);
        if (ret == null) {
            ret = new TreeSet<>(utils.makeClassUseComparator());
            Set<TypeElement> impl = classtree.implementingClasses(te);
            if (impl != null) {
                ret.addAll(impl);
                for (TypeElement anImpl : impl) {
                    ret.addAll(subclasses(anImpl));
                }
            }
            for (TypeElement intfc : subinterfaces(te)) {
                ret.addAll(implementingClasses(intfc));
            }
            addAll(classToImplementingClass, te, ret);
        }
        return ret;
    }
private Collection < TypeElement > implementingClasses ( TypeElement te ) { Collection < TypeElement > ret = classToImplementingClass . get ( te ) ; if ( ret == null ) { ret = new TreeSet < > ( utils . makeClassUseComparator ( ) ) ; Set < TypeElement > impl = classtree . implementingClasses ( te ) ; if ( impl != null ) { ret . addAll ( impl ) ; for ( TypeElement anImpl : impl ) { ret . addAll ( subclasses ( anImpl ) ) ; } } for ( TypeElement intfc : subinterfaces ( te ) ) { ret . addAll ( implementingClasses ( intfc ) ) ; } addAll ( classToImplementingClass , te , ret ) ; } return ret ; }
Return all implementing classes of an interface (including all subClasses of implementing
classes and all classes implementing subInterfaces) AND fill-in both classToImplementingClass
and classToSubinterface maps.