コード例 #1
0
  public ModuleEnvironment getParentRoot() {
    ModuleEnvironment parentModule = this;
    while (parentModule.getParentScope() != null)
      parentModule = (ModuleEnvironment) parentModule.getParentScope();

    return parentModule;
  }
コード例 #2
0
  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;
  }
コード例 #3
0
  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;
  }