Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.search.api.client.search.results
Interface ResultSet

All Superinterfaces:
Collection<ResultItem>, Iterable<ResultItem>, List<ResultItem>
All Known Implementing Classes:
ResultSetImpl

public interface ResultSet
extends List<ResultItem>

Result set.

Author:
Julien Anguenot

Field Summary
static String ALWAYS_DETACH_SEARCH_RESULTS_KEY
           
 
Method Summary
 int getOffset()
          Returns the current offset for this result set.
 int getPageHits()
          Returns the amount of actual matching results.
 int getPageNumber()
          Computes the page number among the total set of results.
 int getRange()
          Returns the amount of results from offset requested.
 int getTotalHits()
          Returns the total number of hits this resultset comes from.
 ResultSet goToPage(int page)
          Goes to requested page.
 boolean hasNextPage()
          Is there another page available?
 boolean isFirstPage()
          Is this result set the first page of results?
 ResultSet nextPage()
          Computes the next page by replaying the exact same request.
 ResultSet replay()
          Replays the exact same query.
 ResultSet replay(int offset, int range)
          Replays the same query with new offset and range.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Field Detail

ALWAYS_DETACH_SEARCH_RESULTS_KEY

static final String ALWAYS_DETACH_SEARCH_RESULTS_KEY
See Also:
Constant Field Values
Method Detail

getOffset

int getOffset()
Returns the current offset for this result set.

Returns:
the offset as an integer.

getRange

int getRange()
Returns the amount of results from offset requested.

Returns:
the amount of results from offset requested.

getTotalHits

int getTotalHits()
Returns the total number of hits this resultset comes from.

Returns:
an integer value

getPageHits

int getPageHits()
Returns the amount of actual matching results.

This is in contrast to getRange() that returns the maximum number of results per page.

Returns:
the amount of actual matching results.

replay

ResultSet replay()
                 throws SearchException
Replays the exact same query.

Returns:
a new, updated ResultSet
Throws:
SearchException

replay

ResultSet replay(int offset,
                 int range)
                 throws SearchException
Replays the same query with new offset and range.

Parameters:
offset - the new offset
range - the new range
Returns:
a new, updated ResultSet
Throws:
SearchException

nextPage

ResultSet nextPage()
                   throws SearchException
Computes the next page by replaying the exact same request.

Returns:
the next computed page or null if there is none.
Throws:
SearchException

goToPage

ResultSet goToPage(int page)
                   throws SearchException
Goes to requested page.

Parameters:
page - the page to go to
Returns:
the next computed page or null if there is none.
Throws:
SearchException

hasNextPage

boolean hasNextPage()
Is there another page available?

Returns:
true if next page available / false if not.

isFirstPage

boolean isFirstPage()
Is this result set the first page of results?

Returns:
true if first page / false of not.

getPageNumber

int getPageNumber()
Computes the page number among the total set of results.

Returns:
the page number

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.