|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.appengine.api.datastore.Cursor
public final class Cursor
A cursor that represents a position in a query.
To resume a Query at the position defined by a Cursor, the
Cursor must be present in the FetchOptions passed to a PreparedQuery identical to the one it was created from.
Cursors can be retrieved from PreparedQuery.asQueryResult* functions.
A typical use case would be:
The encoded cursor can then be passed safely in a get or post arg of a web request and on another request the next batch of results can be retrieved with:Cursor originalCursor = preparedQuery.asQueryResultList(withLimit(20)).getCursor(); String encodedCursor = original.toWebSafeString();
Cursor decodedCursor = Cursor.fromWebSafeString(encodedCursor); ListnextBatch = preparedQuery.asQueryResultList(withLimit(20).cursor(decoded));
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
|
static Cursor |
fromWebSafeString(java.lang.String encodedCursor)
Decodes the given encoded cursor |
int |
hashCode()
|
Cursor |
reverse()
|
java.lang.String |
toString()
|
java.lang.String |
toWebSafeString()
Encodes the current cursor as a web safe string that can later be decoded by fromWebSafeString(String) |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public Cursor reverse()
Query.reverse()public java.lang.String toWebSafeString()
fromWebSafeString(String)
public static Cursor fromWebSafeString(java.lang.String encodedCursor)
encodedCursor -
java.lang.IllegalArgumentException - if the provided string is not a valid encoded cursorpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||