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
Fields Modifier and Type Field Description static String
ALWAYS_DETACH_SEARCH_RESULTS_KEY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.Collection
parallelStream, removeIf, stream, toArray
-
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, replaceAll, retainAll, set, size, sort, spliterator, 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 offsetrange
- 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
-
-