/** * @param nodes a set of nodes to be contained */ public DefaultNodeSet(Stream<Node<E>> nodes) { addAllNodes(checkNotNull(nodes, "nodes cannot be null")); }
/** * Adds the specified entities as <code>Node</code>s to this set. * @param entities The entities to be added. Each entity will be wrapped in a <code>Node</code> which will then * be added to this <code>NodeSet</code>. */ public void addDifferentEntities(Set<E> entities) { for(E e : entities) { addNode(getNode(e)); } }
@Override public boolean isBottomSingleton() { return isSingleton() && nodes.iterator().next().isBottomNode(); }
protected void addClasses(boolean direct, DefaultNodeSet<OWLClass> result, OWLClassExpression domain) { result.addNode(getEquivalentClasses(domain)); if (!direct) { result.addAllNodes(getSuperClasses(domain, false).nodes()); } }
/** * @param node the node to be contained */ public DefaultNodeSet(Node<E> node) { addNode(checkNotNull(node, "node cannot be null")); }
/** * Adds the set of entities as a {@code Node} to this set. * * @param entities The set of entities to be added. The entities will be wrapped in a {@code * Node} which will be added to this {@code NodeSet}. */ public void addSameEntities(Set<E> entities) { nodes.add(getNode(entities)); }
public NodeSet<T> getNodeHierarchyParents(T child, boolean direct, DefaultNodeSet<T> ns) { if(child.equals(topEntity)) { return ns; } Collection<T> parents = getParentsInternal(child, null); for (Iterator<T> parIt = parents.iterator(); parIt.hasNext();) { T par = parIt.next(); Node<T> cycleNode = cycles.get(par); if (cycleNode != null) { ns.addNode(cycleNode); parIt.remove(); } else { ns.addEntity(par); } if (!direct) { getNodeHierarchyParents(par, direct, ns); } } return ns; }
@Override public Stream<E> entities() { return nodes().flatMap(Node::entities); }
protected void addClasses(boolean direct, DefaultNodeSet<OWLClass> result, OWLClassExpression domain) { result.addNode(getEquivalentClasses(domain)); if (!direct) { result.addAllNodes(getSuperClasses(domain, false).nodes()); } }
/** * @param node the node to be contained */ public DefaultNodeSet(Node<E> node) { addNode(checkNotNull(node, "node cannot be null")); }
/** * Adds the set of entities as a {@code Node} to this set. * * @param entities The set of entities to be added. The entities will be wrapped in a {@code * Node} which will be added to this {@code NodeSet}. */ public void addSameEntities(Set<E> entities) { nodes.add(getNode(entities)); }
public NodeSet<T> getNodeHierarchyChildren(T parent, boolean direct, DefaultNodeSet<T> ns) { if(parent.equals(bottomEntity)) { return ns; } Collection<T> children = getChildrenInternal(parent); for (Iterator<T> childIt = children.iterator(); childIt.hasNext();) { T child = childIt.next(); Node<T> cycleNode = cycles.get(child); if (cycleNode != null) { if (!cycleNode.contains(parent)) { ns.addNode(cycleNode); } childIt.remove(); } else { ns.addEntity(child); } if (!direct) { getNodeHierarchyChildren(child, direct, ns); } } return ns; }
@Override public Stream<E> entities() { return nodes().flatMap(Node::entities); }
protected void addClasses(boolean direct, DefaultNodeSet<OWLClass> result, OWLClassExpression domain) { result.addNode(getEquivalentClasses(domain)); if (!direct) { result.addAllNodes(getSuperClasses(domain, false).nodes()); } }
/** * Adds the specified entities as <code>Node</code>s to this set. * @param entities The entities to be added. Each entity will be wrapped in a <code>Node</code> which will then * be added to this <code>NodeSet</code>. */ //XXX not in the interface public void addDifferentEntities(Set<E> entities) { for (E e : entities) { addNode(getNode(e)); } }
/** * @param node the node to be contained */ public DefaultNodeSet(Node<E> node) { addNode(checkNotNull(node, "node cannot be null")); }
/** * @param nodes a set of nodes to be contained */ public DefaultNodeSet(Set<Node<E>> nodes) { addAllNodes(checkNotNull(nodes, "nodes cannot be null")); }
@Override public boolean isTopSingleton() { return isSingleton() && nodes.iterator().next().isTopNode(); }
/** * @param entity the entity to be contained */ public DefaultNodeSet(E entity) { nodes.add(getNode(entity)); }
@Override public Stream<E> entities() { return nodes().flatMap(Node::entities); }