Pos(String name, LexicalCategory category, LexicalCategory additional) { this.uri = new IRI(OLIA_NAMESPACE + (name == null ? name() : name)); categories = EnumSet.of(category); if (additional != null) { categories.add(additional); } parents = Collections.emptySet(); }
Pos(String name, LexicalCategory category, LexicalCategory additional) { this.uri = new IRI(OLIA_NAMESPACE + (name == null ? name() : name)); categories = EnumSet.of(category); if (additional != null) { categories.add(additional); } parents = Collections.emptySet(); }
Pos(String name, LexicalCategory category, Pos... parent) { this.uri = new IRI(OLIA_NAMESPACE + (name == null ? name() : name)); this.parents = parent == null || parent.length < 1 ? Collections.EMPTY_SET : Arrays.asList(parent); categories = category == null ? EnumSet.noneOf(LexicalCategory.class) : EnumSet.of(category); Set<Pos> toProcess = new HashSet<Pos>(parents); while (!toProcess.isEmpty()) { Iterator<Pos> it = toProcess.iterator(); Pos p = it.next(); it.remove(); categories.addAll(p.categories); toProcess.addAll(p.parents); } }
Pos(String name, LexicalCategory category, Pos... parent) { this.uri = new IRI(OLIA_NAMESPACE + (name == null ? name() : name)); this.parents = parent == null || parent.length < 1 ? Collections.EMPTY_SET : Arrays.asList(parent); categories = category == null ? EnumSet.noneOf(LexicalCategory.class) : EnumSet.of(category); Set<Pos> toProcess = new HashSet<Pos>(parents); while (!toProcess.isEmpty()) { Iterator<Pos> it = toProcess.iterator(); Pos p = it.next(); it.remove(); categories.addAll(p.categories); toProcess.addAll(p.parents); } }