public boolean replaceChild(AbstractPlanNode oldChild, AbstractPlanNode newChild) {
        assert(oldChild != null);
        assert(newChild != null);
        int idx = 0;
        for (AbstractPlanNode child : m_children) {
            if (child.equals(oldChild)) {
                oldChild.m_parents.clear();
                setAndLinkChild(idx, newChild);
                return true;
            }
            ++idx;
        }
        return false;
    }
public boolean replaceChild ( AbstractPlanNode oldChild , AbstractPlanNode newChild ) { assert ( oldChild != null ) ; assert ( newChild != null ) ; int idx = 0 ; for ( AbstractPlanNode child : m_children ) { if ( child . equals ( oldChild ) ) { oldChild . m_parents . clear ( ) ; setAndLinkChild ( idx , newChild ) ; return true ; } ++ idx ; } return false ; }
Replace an existing child with a new one preserving the child's position.
@param oldChild The node to replace.
@param newChild The new node.
@return true if the child was replaced