public boolean hasModule() { return getModule() != null; } abstract public boolean hasCompilationUnit(String pkgName, String moduleName);
public boolean hasModule() { return getModule() != null; } abstract public boolean hasCompilationUnit(String pkgName, String moduleName);
@Override public char[][] getAllAutomaticModules() { if (this.moduleLocations == null || this.moduleLocations.size() == 0) return CharOperation.NO_CHAR_CHAR; Set<char[]> set = this.moduleLocations.values().stream().map(e -> e.getModule()).filter(m -> m != null && m.isAutomatic()) .map(m -> m.name()).collect(Collectors.toSet()); return set.toArray(new char[set.size()][]); }
@Override public char[][] getAllAutomaticModules() { if (this.moduleLocations == null || this.moduleLocations.size() == 0) return CharOperation.NO_CHAR_CHAR; Set<char[]> set = this.moduleLocations.values().stream().map(e -> e.getModule()).filter(m -> m != null && m.isAutomatic()) .map(m -> m.name()).collect(Collectors.toSet()); return set.toArray(new char[set.size()][]); } }
@Override public Collection<String> getModuleNames(Collection<String> limitModules) { Set<String> result = new HashSet<>(); for (ClasspathLocation loc : this.locations) { if (loc instanceof IMultiModuleEntry) result.addAll(((IMultiModuleEntry) loc).getModuleNames(limitModules)); else result.add(String.valueOf(loc.getModule().name())); } return result; } }
@Override public Collection<String> getModuleNames(Collection<String> limitModules) { Set<String> result = new HashSet<>(); for (ClasspathLocation loc : this.locations) { if (loc instanceof IMultiModuleEntry) result.addAll(((IMultiModuleEntry) loc).getModuleNames(limitModules)); else result.add(String.valueOf(loc.getModule().name())); } return result; } }
@Override public IModule getModule(char[] name) { for (ClasspathLocation loc : this.locations) { if (loc instanceof IMultiModuleEntry) { IModule mod = ((IMultiModuleEntry) loc).getModule(name); if (mod != null) return mod; } else { IModule mod = loc.getModule(); if (CharOperation.equals(mod.name(), name)) return mod; } } return null; }
@Override public IModule getModule(char[] name) { for (ClasspathLocation loc : this.locations) { if (loc instanceof IMultiModuleEntry) { IModule mod = ((IMultiModuleEntry) loc).getModule(name); if (mod != null) return mod; } else { IModule mod = loc.getModule(); if (CharOperation.equals(mod.name(), name)) return mod; } } return null; }