本文整理汇总了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;
}
示例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;
}
};
}
示例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);
}