public class ResultSetImpl extends ArrayList<ResultItem> implements ResultSet
Modifier and Type | Field and Description |
---|---|
protected Boolean |
detachResultsFlag |
protected int |
offset |
protected int |
pageHits |
protected String |
query |
protected int |
range
0 means all results
|
protected CoreSession |
session |
protected SQLQuery |
sqlQuery |
protected int |
totalHits |
modCount
ALWAYS_DETACH_SEARCH_RESULTS_KEY
Constructor and Description |
---|
ResultSetImpl(String query,
CoreSession session,
int offset,
int range,
List<ResultItem> resultItems,
int totalHits,
int pageHits)
Constructor used when a CoreSession is available.
|
Modifier and Type | Method and Description |
---|---|
boolean |
detachResults() |
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.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
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
parallelStream, removeIf, stream
protected final int offset
protected final int range
protected final int totalHits
protected final int pageHits
protected final CoreSession session
protected Boolean detachResultsFlag
public ResultSetImpl(String query, CoreSession session, int offset, int range, List<ResultItem> resultItems, int totalHits, int pageHits)
public boolean detachResults()
public int getOffset()
ResultSet
public int getRange()
ResultSet
public ResultSet nextPage() throws SearchException
ResultSet
nextPage
in interface ResultSet
SearchException
public ResultSet goToPage(int page) throws SearchException
ResultSet
goToPage
in interface ResultSet
page
- the page to go toSearchException
public int getTotalHits()
ResultSet
getTotalHits
in interface ResultSet
public int getPageHits()
ResultSet
This is in contrast to getRange() that returns the maximum number of results per page.
getPageHits
in interface ResultSet
public boolean hasNextPage()
ResultSet
hasNextPage
in interface ResultSet
public boolean isFirstPage()
ResultSet
isFirstPage
in interface ResultSet
public ResultSet replay() throws SearchException
ResultSet
replay
in interface ResultSet
SearchException
public ResultSet replay(int offset, int range) throws SearchException
ResultSet
replay
in interface ResultSet
offset
- the new offsetrange
- the new rangeSearchException
public int getPageNumber()
ResultSet
getPageNumber
in interface ResultSet
Copyright © 2017 Nuxeo. All rights reserved.