public class Pager extends Object
| Constructor and Description |
|---|
Pager(int numOfResults,
int itemsPerPage,
String resourceName,
int clientStartPage,
int clientStartIndex,
int clientCount)
Creates a new Pages
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCurrentPageResultCount()
Returns the number of results in the current page
|
int |
getCurrPage()
Returns the current page number
|
URL |
getPageQuery()
Returns a query for the current page of search results using a query builder among the ones available
|
QueryBuilder |
getQueryBuilder()
Returns the query builder used to construct queries
|
int |
getTotalResultCount()
Returns the number of results obtained so far
|
boolean |
hasNext()
Determines whether there exist more results available in a next page
|
void |
next(OpenSearchResponse response,
int resultsRetrieved)
Advances the current page by one
|
void |
setContext(List<QueryBuilder> queryBuilders,
String MIMEType)
Provides the pager with a list of query builders to be used and the type of the search results
that the provider returns
|
public Pager(int numOfResults,
int itemsPerPage,
String resourceName,
int clientStartPage,
int clientStartIndex,
int clientCount)
numOfResults - The total number of results that should be obtaineditemsPerPage - The items to request per pageresourceName - The name of the OpenSearch provider that is being queriedclientStartPage - The start page requested by the client which invoked the OpenSearchOp, as present in its queryclientStartIndex - The start index requested by the client which invoked the OpenSearchOp, as present in its queryclientCount - The result count requested by the client which invoked the OpenSearchOp, as present in its querypublic void setContext(List<QueryBuilder> queryBuilders, String MIMEType)
queryBuilders - The query builders to useMIMEType - The MIME type of the search results that the provider returnspublic URL getPageQuery() throws Exception
Exception - If an error occurred while formulating a query, if the context is not set or in case of other errorpublic void next(OpenSearchResponse response, int resultsRetrieved)
response - The search response for the current page, potentially including OpenSearch response attributesresultsRetrieved - The number of results retrieved in the current pagepublic boolean hasNext()
public int getTotalResultCount()
public int getCurrentPageResultCount()
public QueryBuilder getQueryBuilder()
public int getCurrPage()
Copyright © 2014. All Rights Reserved.