private void rightDeleteWithSuccessor(
                                         GBSNode           p,
                                         GBSNode           l,
                                         Object            deleteKey,
                                         DeleteNode        point)
    {
        java.util.Comparator comp = p.deleteComparator();
        int xcc = comp.compare(deleteKey, l.leftMostKey());

        if (xcc == 0)                /* Target key IS low key of successor    */
        {
            /* Migrate up high key of current (delete key)
                into low key of successor (target key)                  */
            point.setDelete(p, p.rightMostIndex());
            point.setTarget(l, 0, DeleteNode.OVERLAY_LEFT);
        }
        else if (xcc < 0)            /* Less than left most key of successor  */
        {
            /* Target is in right of current         */
            int ix = p.findDeleteInRight(deleteKey);
            if (ix >= 0)
                point.setDelete(p, ix);
        }
        else                        /* Greater than left most of successor   */
        {
            /* Target is in left of successor        */
            int ix = l.findDeleteInLeft(deleteKey);
            if (ix >= 0)
            {
                /* Migrate up high key of current (delete key) into
                    low key of successor (hole left after keys moved)           */
                point.setDelete(p, p.rightMostIndex());
                point.setTarget(l, ix, DeleteNode.ADD_LEFT);
            }
        }
    }
private void rightDeleteWithSuccessor ( GBSNode p , GBSNode l , Object deleteKey , DeleteNode point ) { java . util . Comparator comp = p . deleteComparator ( ) ; int xcc = comp . compare ( deleteKey , l . leftMostKey ( ) ) ; if ( xcc == 0 ) { point . setDelete ( p , p . rightMostIndex ( ) ) ; point . setTarget ( l , 0 , DeleteNode . OVERLAY_LEFT ) ; } else if ( xcc < 0 ) { int ix = p . findDeleteInRight ( deleteKey ) ; if ( ix >= 0 ) point . setDelete ( p , ix ) ; } else { int ix = l . findDeleteInLeft ( deleteKey ) ; if ( ix >= 0 ) { point . setDelete ( p , p . rightMostIndex ( ) ) ; point . setTarget ( l , ix , DeleteNode . ADD_LEFT ) ; } } }
Delete from right side with successor node present.