public void addIntermediary ( AbstractPlanNode node ) { // transfer this node's children to node Iterator < AbstractPlanNode > it = m_children . iterator ( ) ; while ( it . hasNext ( ) ) { AbstractPlanNode child = it . next ( ) ; it . remove ( ) ; // remove this.child from m_children assert child . getParentCount ( ) == 1 ; child . clearParents ( ) ; // and reset child's parents list node . addAndLinkChild ( child ) ; // set node.child and child.parent } // and add node to this node's children assert ( m_children . size ( ) == 0 ) ; addAndLinkChild ( node ) ; }
Interject the provided node between this node and this node s current children