当前位置: 首页>>代码示例>>Java>>正文


Java ResultSet.hasMore方法代码示例

本文整理汇总了Java中org.alfresco.service.cmr.search.ResultSet.hasMore方法的典型用法代码示例。如果您正苦于以下问题:Java ResultSet.hasMore方法的具体用法?Java ResultSet.hasMore怎么用?Java ResultSet.hasMore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.service.cmr.search.ResultSet的用法示例。


在下文中一共展示了ResultSet.hasMore方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hasMore

import org.alfresco.service.cmr.search.ResultSet; //导入方法依赖的package包/类
public boolean hasMore()
{
    for (ResultSet resultSet : wrapped.values())
    {
        if (resultSet.hasMore())
        {
            return true;
        }
    }
    return false;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:12,代码来源:CMISResultSet.java

示例2: asPagingResults

import org.alfresco.service.cmr.search.ResultSet; //导入方法依赖的package包/类
private PagingResults<Reference> asPagingResults(ActualEnvironment environment, PagingRequest pagingRequest,
            ResultSet result, Reference parentReference) throws ActualEnvironmentException
{
    final List<Reference> page = new LinkedList<Reference>();

    for (ResultSetRow row : result)
    {
        page.add(NodeProtocol.newReference(row.getNodeRef(),
                                           parentReference));
    }

    final boolean hasMore = result.hasMore();
    final int totalFirst = (int) result.getNumberFound();
    int start;
    try
    {
        start = result.getStart();
    }
    catch (UnsupportedOperationException e)
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("Unsupported ResultSet.getStart() when trying to create query paging result");
        }
        if (pagingRequest != null)
        {
            start = pagingRequest.getSkipCount();
        }
        else
        {
            start = 0;
        }
    }
    final int totlaSecond = !hasMore ? (int) result.getNumberFound() : (int) (start + result.getNumberFound() + 1);
    final Pair<Integer, Integer> total = new Pair<Integer, Integer>(totalFirst,
                                                                    totlaSecond);
    return new PagingResults<Reference>()
    {

        @Override
        public List<Reference> getPage()
        {
            return page;
        }

        @Override
        public boolean hasMoreItems()
        {
            return hasMore;
        }

        @Override
        public Pair<Integer, Integer> getTotalResultCount()
        {

            return total;
        }

        @Override
        public String getQueryExecutionId()
        {
            return null;
        }

    };
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:67,代码来源:VirtualQueryImpl.java

示例3: toCollectionWithPagingInfo

import org.alfresco.service.cmr.search.ResultSet; //导入方法依赖的package包/类
/**
 * Turns the results into a CollectionWithPagingInfo
 * @param params
 * @param searchQuery
 *@param results  @return CollectionWithPagingInfo<Node>
 */
public CollectionWithPagingInfo<Node> toCollectionWithPagingInfo(Params params, SearchRequestContext searchRequestContext, SearchQuery searchQuery, ResultSet results)
{
    SearchContext context = null;
    Integer total = null;
    List<Node> noderesults = new ArrayList<Node>();
    Map<String, UserInfo> mapUserInfo = new HashMap<>(10);
    Map<NodeRef, List<Pair<String, List<String>>>> hightLighting = results.getHighlighting();
    int notFound = 0;
    boolean isHistory = searchRequestContext.getStores().contains(StoreMapper.HISTORY);

    for (ResultSetRow row:results)
    {
        Node aNode = getNode(row, params, mapUserInfo, isHistory);

        if (aNode != null)
        {
            float f = row.getScore();
            List<HighlightEntry> highlightEntries = null;
            List<Pair<String, List<String>>> high = hightLighting.get(row.getNodeRef());

            if (high != null && !high.isEmpty())
            {
                highlightEntries = new ArrayList<HighlightEntry>(high.size());
                for (Pair<String, List<String>> highlight:high)
                {
                    highlightEntries.add(new HighlightEntry(highlight.getFirst(), highlight.getSecond()));
                }
            }
            aNode.setSearch(new SearchEntry(f, highlightEntries));
            noderesults.add(aNode);
        }
        else
        {
            logger.debug("Unknown noderef returned from search results "+row.getNodeRef());
            notFound++;
        }
    }

    SolrJSONResultSet solrResultSet = findSolrResultSet(results);

    if (solrResultSet != null)
    {
        //We used Solr for this query
        context = toSearchContext(solrResultSet, searchRequestContext, searchQuery, notFound);
        total = setTotal(solrResultSet);
    }
    else
    {
        //This probably wasn't solr
        if (!results.hasMore())
        {
            //If there are no more results then we are confident that the number found is correct
            //otherwise we are not confident enough that its accurate
            total = setTotal(results);
        }
    }

    return CollectionWithPagingInfo.asPaged(params.getPaging(), noderesults, results.hasMore(), total, null, context);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:66,代码来源:ResultMapper.java


注:本文中的org.alfresco.service.cmr.search.ResultSet.hasMore方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。