Add docs to the src
[frozenviper.git] / docs / google-appengine-docs-20100817 / appengine / docs / java / javadoc / com / google / appengine / api / datastore / Cursor.html
blob87552630f76ea4684ba86a568348fc2f46d05eb0
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
5 <script type="text/javascript" language="JavaScript">
6 ORIGINAL_PAGE_PATH = "/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Cursor.html";
7 </script>
9 <!-- Generated by javadoc (build 1.6.0-google-internal) on Fri Aug 13 13:39:09 CDT 2010 -->
10 <TITLE>
11 Cursor
12 </TITLE>
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";
25 </SCRIPT>
26 <NOSCRIPT>
27 </NOSCRIPT>
29 </HEAD>
31 <BODY BGCOLOR="white" onload="windowTitle();">
32 <HR>
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="">
39 <TR>
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>&nbsp;</TD>
45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
46 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
48 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
49 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
50 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
51 </TR>
52 </TABLE>
53 </TD>
54 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
55 </EM>
56 </TD>
57 </TR>
59 <TR>
60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61 &nbsp;<A HREF="CompositeIndexManager.html" title="class in com.google.appengine.api.datastore"><B>PREV CLASS</B></A>&nbsp;
62 &nbsp;<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> &nbsp;
65 &nbsp;<A HREF="Cursor.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
66 &nbsp;<SCRIPT type="text/javascript">
67 <!--
68 if(window==top) {
69 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
71 //-->
72 </SCRIPT>
73 <NOSCRIPT>
74 <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
75 </NOSCRIPT>
78 </FONT></TD>
79 </TR>
80 <TR>
81 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
82 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
83 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
84 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
85 </TR>
86 </TABLE>
87 <A NAME="skip-navbar_top"></A>
88 <!-- ========= END OF TOP NAVBAR ========= -->
90 <HR>
91 <!-- ======== START OF CLASS DATA ======== -->
92 <H2>
93 <FONT SIZE="-1">
94 com.google.appengine.api.datastore</FONT>
95 <BR>
96 Class Cursor</H2>
97 <PRE>
98 java.lang.Object
99 <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.google.appengine.api.datastore.Cursor</B>
100 </PRE>
101 <DL>
102 <DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD>
103 </DL>
104 <HR>
105 <DL>
106 <DT><PRE>public final class <B>Cursor</B><DT>extends java.lang.Object<DT>implements java.io.Serializable</DL>
107 </PRE>
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:
118 <blockquote>
119 <pre>
120 Cursor originalCursor = preparedQuery.asQueryResultList(withLimit(20)).getCursor();
121 String encodedCursor = original.toWebSafeString();
122 </pre>
123 </blockquote>
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:
128 <blockquote>
129 <pre>
130 Cursor decodedCursor = Cursor.fromWebSafeString(encodedCursor);
131 List<Entity> nextBatch = preparedQuery.asQueryResultList(withLimit(20).cursor(decoded));
132 </pre>
133 </blockquote>
137 <DL>
138 <DT><B>See Also:</B><DD><A HREF="../../../../../serialized-form.html#com.google.appengine.api.datastore.Cursor">Serialized Form</A></DL>
139 <HR>
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>
150 </TR>
151 <TR BGCOLOR="white" CLASS="TableRowColor">
152 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
153 <CODE>&nbsp;boolean</CODE></FONT></TD>
154 <TD><CODE><B><A HREF="Cursor.html#equals(java.lang.Object)">equals</A></B>(java.lang.Object&nbsp;obj)</CODE>
156 <BR>
157 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
158 </TR>
159 <TR BGCOLOR="white" CLASS="TableRowColor">
160 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
161 <CODE>static&nbsp;<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&nbsp;encodedCursor)</CODE>
164 <BR>
165 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Decodes the given encoded cursor</TD>
166 </TR>
167 <TR BGCOLOR="white" CLASS="TableRowColor">
168 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
169 <CODE>&nbsp;int</CODE></FONT></TD>
170 <TD><CODE><B><A HREF="Cursor.html#hashCode()">hashCode</A></B>()</CODE>
172 <BR>
173 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
174 </TR>
175 <TR BGCOLOR="white" CLASS="TableRowColor">
176 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
177 <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
178 <TD><CODE><B><A HREF="Cursor.html#toString()">toString</A></B>()</CODE>
180 <BR>
181 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
182 </TR>
183 <TR BGCOLOR="white" CLASS="TableRowColor">
184 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
185 <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
186 <TD><CODE><B><A HREF="Cursor.html#toWebSafeString()">toWebSafeString</A></B>()</CODE>
188 <BR>
189 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>
191 </TR>
192 </TABLE>
193 &nbsp;<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>
197 </TR>
198 <TR BGCOLOR="white" CLASS="TableRowColor">
199 <TD><CODE>getClass, notify, notifyAll, wait, wait, wait</CODE></TD>
200 </TR>
201 </TABLE>
202 &nbsp;
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>
212 </TR>
213 </TABLE>
215 <A NAME="toWebSafeString()"><!-- --></A><H3>
216 toWebSafeString</H3>
217 <PRE>
218 public java.lang.String <B>toWebSafeString</B>()</PRE>
219 <DL>
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>
223 <DD><DL>
224 </DL>
225 </DD>
226 <DD><DL>
227 </DL>
228 </DD>
229 </DL>
230 <HR>
232 <A NAME="fromWebSafeString(java.lang.String)"><!-- --></A><H3>
233 fromWebSafeString</H3>
234 <PRE>
235 public static <A HREF="Cursor.html" title="class in com.google.appengine.api.datastore">Cursor</A> <B>fromWebSafeString</B>(java.lang.String&nbsp;encodedCursor)</PRE>
236 <DL>
237 <DD>Decodes the given encoded cursor
239 <DD><DL>
240 </DL>
241 </DD>
242 <DD><DL>
243 <DT><B>Parameters:</B><DD><CODE>encodedCursor</CODE> -
244 <DT><B>Returns:</B><DD>the decoded cursor
245 <DT><B>Throws:</B>
246 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the provided string is not a valid encoded cursor</DL>
247 </DD>
248 </DL>
249 <HR>
251 <A NAME="equals(java.lang.Object)"><!-- --></A><H3>
252 equals</H3>
253 <PRE>
254 public boolean <B>equals</B>(java.lang.Object&nbsp;obj)</PRE>
255 <DL>
256 <DD><DL>
257 <DT><B>Overrides:</B><DD><CODE>equals</CODE> in class <CODE>java.lang.Object</CODE></DL>
258 </DD>
259 <DD><DL>
260 </DL>
261 </DD>
262 </DL>
263 <HR>
265 <A NAME="hashCode()"><!-- --></A><H3>
266 hashCode</H3>
267 <PRE>
268 public int <B>hashCode</B>()</PRE>
269 <DL>
270 <DD><DL>
271 <DT><B>Overrides:</B><DD><CODE>hashCode</CODE> in class <CODE>java.lang.Object</CODE></DL>
272 </DD>
273 <DD><DL>
274 </DL>
275 </DD>
276 </DL>
277 <HR>
279 <A NAME="toString()"><!-- --></A><H3>
280 toString</H3>
281 <PRE>
282 public java.lang.String <B>toString</B>()</PRE>
283 <DL>
284 <DD><DL>
285 <DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
286 </DD>
287 <DD><DL>
288 </DL>
289 </DD>
290 </DL>
291 <!-- ========= END OF CLASS DATA ========= -->
292 <HR>
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="">
299 <TR>
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>&nbsp;</TD>
305 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
306 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
307 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
308 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
309 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
310 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
311 </TR>
312 </TABLE>
313 </TD>
314 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
315 </EM>
316 </TD>
317 </TR>
319 <TR>
320 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
321 &nbsp;<A HREF="CompositeIndexManager.html" title="class in com.google.appengine.api.datastore"><B>PREV CLASS</B></A>&nbsp;
322 &nbsp;<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> &nbsp;
325 &nbsp;<A HREF="Cursor.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
326 &nbsp;<SCRIPT type="text/javascript">
327 <!--
328 if(window==top) {
329 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
331 //-->
332 </SCRIPT>
333 <NOSCRIPT>
334 <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
335 </NOSCRIPT>
338 </FONT></TD>
339 </TR>
340 <TR>
341 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
342 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
343 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
344 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
345 </TR>
346 </TABLE>
347 <A NAME="skip-navbar_bottom"></A>
348 <!-- ======== END OF BOTTOM NAVBAR ======= -->
350 <HR>
352 </BODY>
353 </HTML>