public static final List<PlanNode> findAllNodes(PlanNode root, int types) { LinkedList<PlanNode> nodes = new LinkedList<PlanNode>(); findAllNodesHelper(root, types, nodes, NodeConstants.Types.NO_TYPE); return nodes; }
public static final List<PlanNode> findAllNodes(PlanNode root, int types) { LinkedList<PlanNode> nodes = new LinkedList<PlanNode>(); findAllNodesHelper(root, types, nodes, NodeConstants.Types.NO_TYPE); return nodes; }
public static final List<PlanNode> findAllNodes(PlanNode root, int types) { LinkedList<PlanNode> nodes = new LinkedList<PlanNode>(); findAllNodesHelper(root, types, nodes, NodeConstants.Types.NO_TYPE); return nodes; }
/** * Find all nodes of a type, starting at the root of a tree or subtree of * PlanNodes and searching downward, but not searching past nodes of type equal * to stopType. * @param root the top node of the subtree, the point at which searching begins * @param types the types of the node to search for * @param stopTypes type of nodes not to search past * @return Collection of found PlanNodes * @since 4.2 */ public static final List<PlanNode> findAllNodes(PlanNode root, int types, int stopTypes) { LinkedList<PlanNode> nodes = new LinkedList<PlanNode>(); findAllNodesHelper(root, types, nodes, stopTypes); return nodes; }
/** * Find all nodes of a type, starting at the root of a tree or subtree of * PlanNodes and searching downward, but not searching past nodes of type equal * to stopType. * @param root the top node of the subtree, the point at which searching begins * @param types the types of the node to search for * @param stopTypes type of nodes not to search past * @return Collection of found PlanNodes * @since 4.2 */ public static final List<PlanNode> findAllNodes(PlanNode root, int types, int stopTypes) { LinkedList<PlanNode> nodes = new LinkedList<PlanNode>(); findAllNodesHelper(root, types, nodes, stopTypes); return nodes; }
/** * Find all nodes of a type, starting at the root of a tree or subtree of * PlanNodes and searching downward, but not searching past nodes of type equal * to stopType. * @param root the top node of the subtree, the point at which searching begins * @param types the types of the node to search for * @param stopTypes type of nodes not to search past * @return Collection of found PlanNodes * @since 4.2 */ public static final List<PlanNode> findAllNodes(PlanNode root, int types, int stopTypes) { LinkedList<PlanNode> nodes = new LinkedList<PlanNode>(); findAllNodesHelper(root, types, nodes, stopTypes); return nodes; }
private static final void findAllNodesHelper(PlanNode node, int types, List<PlanNode> foundNodes, int stopTypes) { if((node.getType() & types) == node.getType()) { foundNodes.add(node); } if(node.getChildCount() > 0 && (stopTypes == NodeConstants.Types.NO_TYPE || (stopTypes & node.getType()) != node.getType() ) ) { for (PlanNode child : node.getChildren()) { findAllNodesHelper(child, types, foundNodes, stopTypes); } } }
private static final void findAllNodesHelper(PlanNode node, int types, List<PlanNode> foundNodes, int stopTypes) { if((node.getType() & types) == node.getType()) { foundNodes.add(node); } if(node.getChildCount() > 0 && (stopTypes == NodeConstants.Types.NO_TYPE || (stopTypes & node.getType()) != node.getType() ) ) { for (PlanNode child : node.getChildren()) { findAllNodesHelper(child, types, foundNodes, stopTypes); } } }
private static final void findAllNodesHelper(PlanNode node, int types, List<PlanNode> foundNodes, int stopTypes) { if((node.getType() & types) == node.getType()) { foundNodes.add(node); } if(node.getChildCount() > 0 && (stopTypes == NodeConstants.Types.NO_TYPE || (stopTypes & node.getType()) != node.getType() ) ) { for (PlanNode child : node.getChildren()) { findAllNodesHelper(child, types, foundNodes, stopTypes); } } }