1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 <script type=
"text/javascript" language=
"JavaScript">
6 ORIGINAL_PAGE_PATH
= "/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Cursor.html";
9 <!-- Generated by javadoc (build 1.6.0-google-internal) on Fri Aug 13 13:39:09 CDT 2010 -->
14 <META NAME=
"date" CONTENT=
"2010-08-13">
16 <LINK REL =
"stylesheet" TYPE=
"text/css" HREF=
"../../../../../dev_javadoc.css" TITLE=
"Style">
18 <SCRIPT type=
"text/javascript">
19 function windowTitle()
21 if (location.href.indexOf('is-external=true') == -
1) {
22 parent.document.
title=
"Cursor";
31 <BODY BGCOLOR=
"white" onload=
"windowTitle();">
35 <!-- ========= START OF TOP NAVBAR ======= -->
36 <A NAME=
"navbar_top"><!-- --></A>
37 <A HREF=
"#skip-navbar_top" title=
"Skip navigation links"></A>
38 <TABLE BORDER=
"0" WIDTH=
"100%" CELLPADDING=
"1" CELLSPACING=
"0" SUMMARY=
"">
40 <TD COLSPAN=
2 BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1">
41 <A NAME=
"navbar_top_firstrow"><!-- --></A>
42 <TABLE BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"3" SUMMARY=
"">
43 <TR ALIGN=
"center" VALIGN=
"top">
44 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../overview-summary.html"><FONT CLASS=
"NavBarFont1"><B>Overview
</B></FONT></A> </TD>
45 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-summary.html"><FONT CLASS=
"NavBarFont1"><B>Package
</B></FONT></A> </TD>
46 <TD BGCOLOR=
"#FFFFFF" CLASS=
"NavBarCell1Rev"> <FONT CLASS=
"NavBarFont1Rev"><B>Class
</B></FONT> </TD>
47 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-tree.html"><FONT CLASS=
"NavBarFont1"><B>Tree
</B></FONT></A> </TD>
48 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../deprecated-list.html"><FONT CLASS=
"NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
49 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../index-all.html"><FONT CLASS=
"NavBarFont1"><B>Index
</B></FONT></A> </TD>
50 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../help-doc.html"><FONT CLASS=
"NavBarFont1"><B>Help
</B></FONT></A> </TD>
54 <TD ALIGN=
"right" VALIGN=
"top" ROWSPAN=
3><EM>
60 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
61 <A HREF=
"CompositeIndexManager.html" title=
"class in com.google.appengine.api.datastore"><B>PREV CLASS
</B></A>
62 <A HREF=
"DatastoreApiHelper.html" title=
"class in com.google.appengine.api.datastore"><B>NEXT CLASS
</B></A></FONT></TD>
63 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
64 <A HREF=
"../../../../../index.html?com/google/appengine/api/datastore/Cursor.html" target=
"_top"><B>FRAMES
</B></A>
65 <A HREF=
"Cursor.html" target=
"_top"><B>NO FRAMES
</B></A>
66 <SCRIPT type=
"text/javascript">
69 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
74 <A HREF=
"../../../../../allclasses-noframe.html"><B>All Classes
</B></A>
81 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
82 SUMMARY:
NESTED
|
FIELD
|
CONSTR
|
<A HREF=
"#method_summary">METHOD
</A></FONT></TD>
83 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
84 DETAIL:
FIELD
|
CONSTR
|
<A HREF=
"#method_detail">METHOD
</A></FONT></TD>
87 <A NAME=
"skip-navbar_top"></A>
88 <!-- ========= END OF TOP NAVBAR ========= -->
91 <!-- ======== START OF CLASS DATA ======== -->
94 com.google.appengine.api.datastore
</FONT>
99 <IMG SRC=
"../../../../../resources/inherit.gif" ALT=
"extended by "><B>com.google.appengine.api.datastore.Cursor
</B>
102 <DT><B>All Implemented Interfaces:
</B> <DD>java.io.Serializable
</DD>
106 <DT><PRE>public final class
<B>Cursor
</B><DT>extends java.lang.Object
<DT>implements java.io.Serializable
</DL>
110 A cursor that represents a position in a query.
112 To resume a
<A HREF=
"Query.html" title=
"class in com.google.appengine.api.datastore"><CODE>Query
</CODE></A> at the position defined by a
<A HREF=
"Cursor.html" title=
"class in com.google.appengine.api.datastore"><CODE>Cursor
</CODE></A>, the
113 <A HREF=
"Cursor.html" title=
"class in com.google.appengine.api.datastore"><CODE>Cursor
</CODE></A> must be present in the
<A HREF=
"FetchOptions.html" title=
"class in com.google.appengine.api.datastore"><CODE>FetchOptions
</CODE></A> passed to a
<A HREF=
"PreparedQuery.html" title=
"interface in com.google.appengine.api.datastore"><CODE>PreparedQuery
</CODE></A> identical to the one it was created from.
115 Cursors can be retrieved from
<code>PreparedQuery.asQueryResult*
</code> functions.
116 A typical use case would be:
120 Cursor originalCursor = preparedQuery.asQueryResultList(withLimit(
20)).getCursor();
121 String encodedCursor = original.toWebSafeString();
125 The encoded cursor can then be passed safely in a get or post arg of a web
126 request and on another request the next batch of results can be retrieved with:
130 Cursor decodedCursor = Cursor.fromWebSafeString(encodedCursor);
131 List
<Entity> nextBatch = preparedQuery.asQueryResultList(withLimit(
20).cursor(decoded));
138 <DT><B>See Also:
</B><DD><A HREF=
"../../../../../serialized-form.html#com.google.appengine.api.datastore.Cursor">Serialized Form
</A></DL>
143 <!-- ========== METHOD SUMMARY =========== -->
145 <A NAME=
"method_summary"><!-- --></A>
146 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
147 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
148 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
149 <B>Method Summary
</B></FONT></TH>
151 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
152 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
153 <CODE> boolean
</CODE></FONT></TD>
154 <TD><CODE><B><A HREF=
"Cursor.html#equals(java.lang.Object)">equals
</A></B>(java.lang.Object
obj)
</CODE>
157 </TD>
159 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
160 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
161 <CODE>static
<A HREF=
"Cursor.html" title=
"class in com.google.appengine.api.datastore">Cursor
</A></CODE></FONT></TD>
162 <TD><CODE><B><A HREF=
"Cursor.html#fromWebSafeString(java.lang.String)">fromWebSafeString
</A></B>(java.lang.String
encodedCursor)
</CODE>
165 Decodes the given encoded cursor
</TD>
167 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
168 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
169 <CODE> int
</CODE></FONT></TD>
170 <TD><CODE><B><A HREF=
"Cursor.html#hashCode()">hashCode
</A></B>()
</CODE>
173 </TD>
175 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
176 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
177 <CODE> java.lang.String
</CODE></FONT></TD>
178 <TD><CODE><B><A HREF=
"Cursor.html#toString()">toString
</A></B>()
</CODE>
181 </TD>
183 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
184 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
185 <CODE> java.lang.String
</CODE></FONT></TD>
186 <TD><CODE><B><A HREF=
"Cursor.html#toWebSafeString()">toWebSafeString
</A></B>()
</CODE>
189 Encodes the current cursor as a web safe string that can later be decoded
190 by
<A HREF=
"Cursor.html#fromWebSafeString(java.lang.String)"><CODE>fromWebSafeString(String)
</CODE></A></TD>
193 <A NAME=
"methods_inherited_from_class_java.lang.Object"><!-- --></A>
194 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
195 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
196 <TH ALIGN=
"left"><B>Methods inherited from class java.lang.Object
</B></TH>
198 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
199 <TD><CODE>getClass, notify, notifyAll, wait, wait, wait
</CODE></TD>
205 <!-- ============ METHOD DETAIL ========== -->
207 <A NAME=
"method_detail"><!-- --></A>
208 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
209 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
210 <TH ALIGN=
"left" COLSPAN=
"1"><FONT SIZE=
"+2">
211 <B>Method Detail
</B></FONT></TH>
215 <A NAME=
"toWebSafeString()"><!-- --></A><H3>
218 public java.lang.String
<B>toWebSafeString
</B>()
</PRE>
220 <DD>Encodes the current cursor as a web safe string that can later be decoded
221 by
<A HREF=
"Cursor.html#fromWebSafeString(java.lang.String)"><CODE>fromWebSafeString(String)
</CODE></A>
232 <A NAME=
"fromWebSafeString(java.lang.String)"><!-- --></A><H3>
233 fromWebSafeString
</H3>
235 public static
<A HREF=
"Cursor.html" title=
"class in com.google.appengine.api.datastore">Cursor
</A> <B>fromWebSafeString
</B>(java.lang.String
encodedCursor)
</PRE>
237 <DD>Decodes the given encoded cursor
243 <DT><B>Parameters:
</B><DD><CODE>encodedCursor
</CODE> -
244 <DT><B>Returns:
</B><DD>the decoded cursor
246 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the provided string is not a valid encoded cursor
</DL>
251 <A NAME=
"equals(java.lang.Object)"><!-- --></A><H3>
254 public boolean
<B>equals
</B>(java.lang.Object
obj)
</PRE>
257 <DT><B>Overrides:
</B><DD><CODE>equals
</CODE> in class
<CODE>java.lang.Object
</CODE></DL>
265 <A NAME=
"hashCode()"><!-- --></A><H3>
268 public int
<B>hashCode
</B>()
</PRE>
271 <DT><B>Overrides:
</B><DD><CODE>hashCode
</CODE> in class
<CODE>java.lang.Object
</CODE></DL>
279 <A NAME=
"toString()"><!-- --></A><H3>
282 public java.lang.String
<B>toString
</B>()
</PRE>
285 <DT><B>Overrides:
</B><DD><CODE>toString
</CODE> in class
<CODE>java.lang.Object
</CODE></DL>
291 <!-- ========= END OF CLASS DATA ========= -->
295 <!-- ======= START OF BOTTOM NAVBAR ====== -->
296 <A NAME=
"navbar_bottom"><!-- --></A>
297 <A HREF=
"#skip-navbar_bottom" title=
"Skip navigation links"></A>
298 <TABLE BORDER=
"0" WIDTH=
"100%" CELLPADDING=
"1" CELLSPACING=
"0" SUMMARY=
"">
300 <TD COLSPAN=
2 BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1">
301 <A NAME=
"navbar_bottom_firstrow"><!-- --></A>
302 <TABLE BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"3" SUMMARY=
"">
303 <TR ALIGN=
"center" VALIGN=
"top">
304 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../overview-summary.html"><FONT CLASS=
"NavBarFont1"><B>Overview
</B></FONT></A> </TD>
305 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-summary.html"><FONT CLASS=
"NavBarFont1"><B>Package
</B></FONT></A> </TD>
306 <TD BGCOLOR=
"#FFFFFF" CLASS=
"NavBarCell1Rev"> <FONT CLASS=
"NavBarFont1Rev"><B>Class
</B></FONT> </TD>
307 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-tree.html"><FONT CLASS=
"NavBarFont1"><B>Tree
</B></FONT></A> </TD>
308 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../deprecated-list.html"><FONT CLASS=
"NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
309 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../index-all.html"><FONT CLASS=
"NavBarFont1"><B>Index
</B></FONT></A> </TD>
310 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../help-doc.html"><FONT CLASS=
"NavBarFont1"><B>Help
</B></FONT></A> </TD>
314 <TD ALIGN=
"right" VALIGN=
"top" ROWSPAN=
3><EM>
320 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
321 <A HREF=
"CompositeIndexManager.html" title=
"class in com.google.appengine.api.datastore"><B>PREV CLASS
</B></A>
322 <A HREF=
"DatastoreApiHelper.html" title=
"class in com.google.appengine.api.datastore"><B>NEXT CLASS
</B></A></FONT></TD>
323 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
324 <A HREF=
"../../../../../index.html?com/google/appengine/api/datastore/Cursor.html" target=
"_top"><B>FRAMES
</B></A>
325 <A HREF=
"Cursor.html" target=
"_top"><B>NO FRAMES
</B></A>
326 <SCRIPT type=
"text/javascript">
329 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
334 <A HREF=
"../../../../../allclasses-noframe.html"><B>All Classes
</B></A>
341 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
342 SUMMARY:
NESTED
|
FIELD
|
CONSTR
|
<A HREF=
"#method_summary">METHOD
</A></FONT></TD>
343 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
344 DETAIL:
FIELD
|
CONSTR
|
<A HREF=
"#method_detail">METHOD
</A></FONT></TD>
347 <A NAME=
"skip-navbar_bottom"></A>
348 <!-- ======== END OF BOTTOM NAVBAR ======= -->