int beforeFocus = results.size(); results.addAll(getResultsAfterFocus(scope, itemValue, beforeFocus));
int total = countTotalInIndex(scope, results.size()); int matches = countMatches(scope, itemValue, total, results.size());
    private static BrowseInfo doBrowse(BrowseScope scope) throws SQLException    {        // Check for a cached browse        BrowseInfo cachedInfo = BrowseCache.get(scope);        if (cachedInfo != null)        {            return cachedInfo;        }        int transactionIsolation = setTransactionIsolation(scope);        try        {            // Run the Browse queries            // If the focus is an Item, this returns the value            String itemValue = getItemValue(scope);            List results = new ArrayList();            results.addAll(getResultsBeforeFocus(scope, itemValue));            int beforeFocus = results.size();            results.addAll(getResultsAfterFocus(scope, itemValue, beforeFocus));            // Find out the total in the index, and the number of            // matches for the query            int total = countTotalInIndex(scope, results.size());            int matches = countMatches(scope, itemValue, total, results.size());            if (log.isDebugEnabled())            {                log.debug("Number of matches " + matches);            }            int position = getPosition(total, matches, beforeFocus);            sortResults(scope, results);            BrowseInfo info = new BrowseInfo(results, position, total,                    beforeFocus);            logInfo(info);            BrowseCache.add(scope, info);            return info;        }        finally        {            restoreTransactionIsolation(scope, transactionIsolation);        }    }