Search in sources :

Example 1 with LazyElement

use of org.eclipse.ceylon.model.loader.model.LazyElement in project ceylon by eclipse.

the class AbstractModelLoader method inspectForStats.

private int inspectForStats(Map<String, Declaration> cache, Map<Package, Stats> loadedByPackage) {
    int loaded = 0;
    for (Declaration decl : cache.values()) {
        if (decl instanceof LazyElement) {
            Package pkg = getPackage(decl);
            if (pkg == null) {
                logVerbose("[Model loader stats: declaration " + decl.getName() + " has no package. Skipping.]");
                continue;
            }
            Stats stats = loadedByPackage.get(pkg);
            if (stats == null) {
                stats = new Stats();
                loadedByPackage.put(pkg, stats);
            }
            stats.total++;
            if (((LazyElement) decl).isLoaded()) {
                loaded++;
                stats.loaded++;
            }
        }
    }
    return loaded;
}
Also used : LazyElement(org.eclipse.ceylon.model.loader.model.LazyElement) TypedDeclaration(org.eclipse.ceylon.model.typechecker.model.TypedDeclaration) TypeDeclaration(org.eclipse.ceylon.model.typechecker.model.TypeDeclaration) Declaration(org.eclipse.ceylon.model.typechecker.model.Declaration) LazyPackage(org.eclipse.ceylon.model.loader.model.LazyPackage) Package(org.eclipse.ceylon.model.typechecker.model.Package)

Aggregations

LazyElement (org.eclipse.ceylon.model.loader.model.LazyElement)1 LazyPackage (org.eclipse.ceylon.model.loader.model.LazyPackage)1 Declaration (org.eclipse.ceylon.model.typechecker.model.Declaration)1 Package (org.eclipse.ceylon.model.typechecker.model.Package)1 TypeDeclaration (org.eclipse.ceylon.model.typechecker.model.TypeDeclaration)1 TypedDeclaration (org.eclipse.ceylon.model.typechecker.model.TypedDeclaration)1