com.metamatrix.query.optimizer.relational.plantree
Class NodeEditor

java.lang.Object
  extended by com.metamatrix.query.optimizer.relational.plantree.NodeEditor

public final class NodeEditor
extends java.lang.Object

This class is no longer really an editor. Those methods have been moved over to PlanNode. TODO: rename NodeFinder or merge completely with PlanNode


Method Summary
static java.util.List<PlanNode> findAllNodes(PlanNode root, int types)
           
static java.util.List<PlanNode> findAllNodes(PlanNode root, int types, int stopTypes)
          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.
static PlanNode findNodePreOrder(PlanNode root, int types)
           
static PlanNode findNodePreOrder(PlanNode root, int types, int stopTypes)
           
static PlanNode findParent(PlanNode root, int types)
           
static PlanNode findParent(PlanNode root, int types, int stopTypes)
          Return the first parent node of the given type stopping at the given nodes.
static void removeChildNode(PlanNode parent, PlanNode child)
          all of child's children become children of parent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

removeChildNode

public static final void removeChildNode(PlanNode parent,
                                         PlanNode child)
all of child's children become children of parent


findNodePreOrder

public static final PlanNode findNodePreOrder(PlanNode root,
                                              int types)

findNodePreOrder

public static final PlanNode findNodePreOrder(PlanNode root,
                                              int types,
                                              int stopTypes)

findParent

public static final PlanNode findParent(PlanNode root,
                                        int types)

findParent

public static final PlanNode findParent(PlanNode root,
                                        int types,
                                        int stopTypes)
Return the first parent node of the given type stopping at the given nodes. The matching will start at the parent of the node passed in.

Parameters:
root -
type -
stopTypes -
Returns:
the matching parent, or null one is not found

findAllNodes

public static final java.util.List<PlanNode> findAllNodes(PlanNode root,
                                                          int types)

findAllNodes

public static final java.util.List<PlanNode> findAllNodes(PlanNode root,
                                                          int types,
                                                          int stopTypes)
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.

Parameters:
root - the top node of the subtree, the point at which searching begins
types - the types of the node to search for
stopTypes - type of nodes not to search past
Returns:
Collection of found PlanNodes
Since:
4.2


Copyright © 2009. All Rights Reserved.