public void insertParentAfter ( Node node ) throws ChildNodeException { if ( node != null ) { // give this node my children node . setFirstChild ( getFirstChild ( ) ) ; setFirstChild ( null ) ; // clear our list addChild ( node ) ; // make our child } }
Inserts a new Parent Node as a child of this node and moves all pre - existing children to be children of the new Parent Node .