public NodeSet<T> getNodeHierarchyChildren(T parent, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(parent); if (node.isBottomNode()) { return ns; } Set<T> directChildren = new HashSet<>(); for (T equiv : node) { directChildren.addAll(rawParentChildProvider.getChildren(equiv)); if (directParentsOfBottomNode.contains(equiv)) { ns.addNode(nodeCache.getBottomNode()); } } node.entities().forEach(directChildren::remove); if (node.isTopNode()) { // Special treatment directChildren.addAll(directChildrenOfTopNode); } for (Node<T> childNode : nodeCache.getNodes(directChildren)) { ns.addNode(childNode); } if (!direct) { for (T child : directChildren) { getNodeHierarchyChildren(child, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyChildren(T parent, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(parent); if (node.isBottomNode()) { return ns; } Set<T> directChildren = new HashSet<>(); for (T equiv : node) { directChildren.addAll(rawParentChildProvider.getChildren(equiv)); if (directParentsOfBottomNode.contains(equiv)) { ns.addNode(nodeCache.getBottomNode()); } } node.entities().forEach(directChildren::remove); if (node.isTopNode()) { // Special treatment directChildren.addAll(directChildrenOfTopNode); } for (Node<T> childNode : nodeCache.getNodes(directChildren)) { ns.addNode(childNode); } if (!direct) { for (T child : directChildren) { getNodeHierarchyChildren(child, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyChildren(T parent, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(parent); if (node.isBottomNode()) { return ns; } Set<T> directChildren = new HashSet<>(); for (T equiv : node) { directChildren.addAll(rawParentChildProvider.getChildren(equiv)); if (directParentsOfBottomNode.contains(equiv)) { ns.addNode(nodeCache.getBottomNode()); } } node.entities().forEach(directChildren::remove); if (node.isTopNode()) { // Special treatment directChildren.addAll(directChildrenOfTopNode); } for (Node<T> childNode : nodeCache.getNodes(directChildren)) { ns.addNode(childNode); } if (!direct) { for (T child : directChildren) { getNodeHierarchyChildren(child, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyChildren(T parent, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(parent); if (node.isBottomNode()) { return ns; } Set<T> directChildren = new HashSet<>(); for (T equiv : node) { directChildren.addAll(rawParentChildProvider.getChildren(equiv)); if (directParentsOfBottomNode.contains(equiv)) { ns.addNode(nodeCache.getBottomNode()); } } node.entities().forEach(directChildren::remove); if (node.isTopNode()) { // Special treatment directChildren.addAll(directChildrenOfTopNode); } for (Node<T> childNode : nodeCache.getNodes(directChildren)) { ns.addNode(childNode); } if (!direct) { for (T child : directChildren) { getNodeHierarchyChildren(child, direct, ns); } } return ns; }