private boolean internalRemove()
    {
        boolean result = false;
        boolean standardDelete = true;
        GBSNode p = _last1.node();
        int lastx = _last1.index();
        synchronized(_index)
        {
            if (_last1._xno != _index.xno())
                standardDelete = true;
            else // _xno has not changed
            {
                p = _last1.node();
                if ( !p.isLeafNode() )
                    standardDelete = true;
                else // Current node is a leaf
                {
                    if ( (p.population() < 2) || (p.isFull()) )
                        standardDelete = true;
                    else // population > 1
                    {
                        if (_last1._vno == _index.vno())
                            standardDelete = false;
                        else // positioned on leaf with more than one key, can delete
                        {
                            SearchComparator comp = searchComparator(SearchComparator.EQ);
                            lastx = p.searchAll(comp, _last1.key());
                            if (lastx < 0)
                                standardDelete = true;
                            else // positioned on leaf with more than one key, can delete
                                standardDelete = false;
                        }
                    } // population > 1
                } // Current node is a leaf
            } // xno has not changed
            if ( !standardDelete )
                _index.iteratorSpecialDelete(this, p, lastx);
        }

        _deleteCount++;

        if (standardDelete)
            result = _index.delete(_last1.key());
        else
        {
            _specialCount++;
            result = true;
        }

        return result;
    }
private boolean internalRemove ( ) { boolean result = false ; boolean standardDelete = true ; GBSNode p = _last1 . node ( ) ; int lastx = _last1 . index ( ) ; synchronized ( _index ) { if ( _last1 . _xno != _index . xno ( ) ) standardDelete = true ; else { p = _last1 . node ( ) ; if ( ! p . isLeafNode ( ) ) standardDelete = true ; else { if ( ( p . population ( ) < 2 ) || ( p . isFull ( ) ) ) standardDelete = true ; else { if ( _last1 . _vno == _index . vno ( ) ) standardDelete = false ; else { SearchComparator comp = searchComparator ( SearchComparator . EQ ) ; lastx = p . searchAll ( comp , _last1 . key ( ) ) ; if ( lastx < 0 ) standardDelete = true ; else standardDelete = false ; } } } } if ( ! standardDelete ) _index . iteratorSpecialDelete ( this , p , lastx ) ; } _deleteCount ++ ; if ( standardDelete ) result = _index . delete ( _last1 . key ( ) ) ; else { _specialCount ++ ; result = true ; } return result ; }
Remove from the collection the last key returned by next().

<p>Since the collection is allowed to change in arbitrary ways
there is no assumption that the last thing given out still exists.
If vno has not changed since the last call to next we are
positioned on the last thing given out.  If vno has changed but xno
has not we have to assume the current node has changed and we can
try a search of the node to re-esbablish position within it.</p>

<p>If we have position within a node then we can check to see if
direct removal from the node is possible in order to by pass the
call to delete.  Direct removal is possible if the node is a leaf
with more than one key and is also not full.  Removal of the last
key would require removal of the node which might require a tree
re-balance.  Removal of a key from a full node might be the removal
of the last key in a T0 fringe which would require a fringe
re-balance.</p>

<p>Since removal of the current key is expected to be frequent in
the case of expiry there is a chance that we can actually establish
the same position established by GBSTree.findDelete and then call
GBSTree to do the second half (the chaper part) of the delete
operation in all cases.  This should be considered when add
parallelization at a later time.</p>

@return true if the key was there to be removed.