public ModuleEnvironment getParentRoot() { ModuleEnvironment parentModule = this; while (parentModule.getParentScope() != null) parentModule = (ModuleEnvironment) parentModule.getParentScope(); return parentModule; }
public ArrayList<ModuleEnvironment> getAllChildren() { Collection<ModuleEnvironment> allModules = ApplicationMainSymbolTable.getAllModules().values(); ArrayList<ModuleEnvironment> children = new ArrayList<ModuleEnvironment>(); for (ModuleEnvironment module : allModules) if (module.getParentName().equals(getName())) children.add(module); return children; }
public boolean isSubtypeOf(ModuleEnvironment module) { ModuleEnvironment parentModule = this; while (parentModule != null) { if (parentModule.getName().equals(module.getName())) return true; parentModule = (ModuleEnvironment) parentModule.getParentScope(); } return false; }