private void insertFringeMigrate(
                                    InsertStack       stack,
                                    GBSNode           p,
                                    Object            mkey)
    {
        GBSNode endp = p;
        int endIndex = stack.index();
        /* Maximum number of right child nodes   */
        /*  before the fringe must be rebalanced */
        int maxBal = maximumFringeImbalance();

        stack.setMigratingKey(mkey);
        if (mkey != null)              /* Have a key to migrate                 */
        {
            stack.processSubFringe(p); /* See InsertStack.processNode           */
            endp = stack.lastNode();
            endIndex = stack.lastIndex();
        }
        if (stack.migrating())         /* Need a right child for migrating key  */
        {
            _xno++;
            endp.addRightLeaf(stack.migratingKey());
        }

        insertCheckFringeBalance(
                                stack,
                                endp,
                                endIndex,
                                maxBal);

    }
private void insertFringeMigrate ( InsertStack stack , GBSNode p , Object mkey ) { GBSNode endp = p ; int endIndex = stack . index ( ) ; int maxBal = maximumFringeImbalance ( ) ; stack . setMigratingKey ( mkey ) ; if ( mkey != null ) { stack . processSubFringe ( p ) ; endp = stack . lastNode ( ) ; endIndex = stack . lastIndex ( ) ; } if ( stack . migrating ( ) ) { _xno ++ ; endp . addRightLeaf ( stack . migratingKey ( ) ) ; } insertCheckFringeBalance ( stack , endp , endIndex , maxBal ) ; }
Migrate a key from a partial leaf through to the proper place
in its fringe, adding a node to the right side of the fringe
if necessary.

@param stack The stack that has been used to walk the tree
@param p     Node from which we are migrating
@param mkey  The migrating key.  This may be null in which case
there is no key to migrate and we have nothing to do.