|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.spy.memcached.compat.SpyObject
com.couchbase.client.protocol.views.Paginator
public class Paginator
The Paginator allows easy pagination over a ViewResult. It is recommended not to instantiate this object directly, but to obtain a reference through the CouchbaseClient object like this: View view = client.getView("design_doc", "viewname"); Query query = new Query(); int docsPerPage = 15; Paginator paginator = client.paginatedQuery(view, query, docsPerPage);
Constructor Summary | |
---|---|
Paginator(CouchbaseClient client,
View view,
Query query,
int numDocs)
Create a new Paginator. |
Method Summary | |
---|---|
boolean |
hasNext()
Check if there is still a ViewResult left to fetch. |
ViewResponse |
next()
Returns the next ViewResult object to iterate over. |
void |
remove()
Remove is not supported while iterating over a ViewResult. |
Methods inherited from class net.spy.memcached.compat.SpyObject |
---|
getLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Paginator(CouchbaseClient client, View view, Query query, int numDocs)
client
- the CouchbaseClient object to run the queries on.view
- the instance of the View to run the Queries against.query
- the instance of the Query object for the params.numDocs
- the number of the documents to return per page (must be
greater than zero).Method Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator<ViewResponse>
public ViewResponse next()
next
in interface java.util.Iterator<ViewResponse>
public void remove()
remove
in interface java.util.Iterator<ViewResponse>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |