/** * Returns an estimate of a number of classes on given source path (source root) which are * using given package. * @param pkg the package to find the usage frequency for. * @return number of classes using types from given package. */ public int getPackageReferenceCount(@NonNull final ElementHandle<? extends PackageElement> pkg) { Parameters.notNull("pkgName", pkg); //NOI18N if (pkg.getKind() != ElementKind.PACKAGE) { throw new IllegalArgumentException(pkg.toString()); } try { init(); final Integer count = pkgFreqs.get(SourceUtils.getJVMSignature(pkg)[0]); return count == null ? 0 : count; } catch (InterruptedException ie) { return 0; } }
/** * Returns an estimate of a number of classes on given source path (source root) which are * using given type. * @param type the type type to find the usage frequency for. * @return number of classes using the type. */ public int getTypeReferenceCount(@NonNull final ElementHandle<? extends TypeElement> type) { Parameters.notNull("binaryName", type); //NOI18N if (!type.getKind().isClass() && !type.getKind().isInterface() && type.getKind() != ElementKind.OTHER) { throw new IllegalArgumentException(type.toString()); } try { init(); final Integer count = typeFreqs.get(SourceUtils.getJVMSignature(type)[0]); return count == null ? 0 : count; } catch (InterruptedException ie) { return 0; } }
final Pair<Convertor<? super Document, T>,Index> ctu = indexPath.getPatch(convertor); try { final String binaryName = SourceUtils.getJVMSignature(element)[0]; final ElementKind kind = element.getKind(); if (kind == ElementKind.PACKAGE) {