@Override public void preOrder(LogicalNodeVisitor visitor) { visitor.visit(this); subQuery.preOrder(visitor); }
@Override public void postOrder(LogicalNodeVisitor visitor) { subQuery.preOrder(visitor); visitor.visit(this); }
@Override public void postOrder(LogicalNodeVisitor visitor) { subQuery.preOrder(visitor); visitor.visit(this); }
@Override public void preOrder(LogicalNodeVisitor visitor) { visitor.visit(this); subQuery.preOrder(visitor); }
public void preOrder(LogicalNodeVisitor visitor) { visitor.visit(this); child.preOrder(visitor); }
public void preOrder(LogicalNodeVisitor visitor) { visitor.visit(this); child.preOrder(visitor); }
@Override public void preOrder(LogicalNodeVisitor visitor) { getChild().preOrder(visitor); visitor.visit(this); }
@Override public void preOrder(LogicalNodeVisitor visitor) { if (hasSubQuery()) { child.preOrder(visitor); } visitor.visit(this); }
@Override public void postOrder(LogicalNodeVisitor visitor) { visitor.visit(this); if (hasSubQuery()) { child.preOrder(visitor); } } }
/** * Find a parent node of a given-typed operator. * * @param node start node * @param type to find * @return the parent node of a found logical node */ public static <T extends LogicalNode> T findTopParentNode(LogicalNode node, NodeType type) { Preconditions.checkNotNull(node); Preconditions.checkNotNull(type); ParentNodeFinder finder = new ParentNodeFinder(type); node.preOrder(finder); if (finder.getFoundNodes().size() == 0) { return null; } return (T) finder.getFoundNodes().get(0); }
@Override public void preOrder(LogicalNodeVisitor visitor) { if (hasSubQuery()) { child.preOrder(visitor); } visitor.visit(this); }
@Override public void postOrder(LogicalNodeVisitor visitor) { visitor.visit(this); if (hasSubQuery()) { child.preOrder(visitor); } } }
@Override public void preOrder(LogicalNodeVisitor visitor) { getChild().preOrder(visitor); visitor.visit(this); }
/** * Find the top logical node matched to type from the given node * * @param node start node * @param type to find * @return a found logical node */ public static <T extends LogicalNode> T findTopNode(LogicalNode node, NodeType type) { Preconditions.checkNotNull(node); Preconditions.checkNotNull(type); LogicalNodeFinder finder = new LogicalNodeFinder(type); node.preOrder(finder); if (finder.getFoundNodes().size() == 0) { return null; } return (T) finder.getFoundNodes().get(0); }
/** * Find the top logical node matched to type from the given node * * @param node start node * @param type to find * @return a found logical node */ public static <T extends LogicalNode> T findTopNode(LogicalNode node, NodeType type) { Preconditions.checkNotNull(node); Preconditions.checkNotNull(type); LogicalNodeFinder finder = new LogicalNodeFinder(type); node.preOrder(finder); if (finder.getFoundNodes().size() == 0) { return null; } return (T) finder.getFoundNodes().get(0); }
/** * Find a parent node of a given-typed operator. * * @param node start node * @param type to find * @return the parent node of a found logical node */ public static <T extends LogicalNode> T findTopParentNode(LogicalNode node, NodeType type) { Preconditions.checkNotNull(node); Preconditions.checkNotNull(type); ParentNodeFinder finder = new ParentNodeFinder(type); node.preOrder(finder); if (finder.getFoundNodes().size() == 0) { return null; } return (T) finder.getFoundNodes().get(0); }
/** * Find the most bottom logical node matched to type from the given node * * @param node start node * @param type to find * @return a found logical node */ public static <T extends LogicalNode> T findMostBottomNode(LogicalNode node, NodeType... type) { Preconditions.checkNotNull(node); Preconditions.checkNotNull(type); LogicalNodeFinder finder = new LogicalNodeFinder(type); node.preOrder(finder); if (finder.getFoundNodes().size() == 0) { return null; } return (T) finder.getFoundNodes().get(finder.getFoundNodes().size() - 1); }
/** * Find the most bottom logical node matched to type from the given node * * @param node start node * @param type to find * @return a found logical node */ public static <T extends LogicalNode> T findMostBottomNode(LogicalNode node, NodeType... type) { Preconditions.checkNotNull(node); Preconditions.checkNotNull(type); LogicalNodeFinder finder = new LogicalNodeFinder(type); node.preOrder(finder); if (finder.getFoundNodes().size() == 0) { return null; } return (T) finder.getFoundNodes().get(finder.getFoundNodes().size() - 1); }