/*
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.gcloud.datastore;

import java.util.Iterator;

/**
 * The result of a Google Cloud Datastore query submission.
 * When the result is not typed it is possible to cast it to its appropriate type according to
 * the {@link #resultClass} value.
 * Results are loaded lazily; therefore it is possible to get a {@code DatastoreException}
 * upon {@link Iterator#hasNext hasNext} or {@link Iterator#next next} calls.
 *
 * @param <V> the type of the results value.
 */
public interface QueryResults<V> extends Iterator<V> {

  /**
   * Returns the actual class of the result's values.
   */
  Class<?> resultClass();

  /**
   * Returns the Cursor for point after the value returned in the last {@link #next} call.
   */
  Cursor cursorAfter();
}

@@ -1276,16 +1276,20 @@
 sor for 
+the 
 point af
@@ -1342,16 +1342,682 @@
 t%7D call.
+ This%0A   * cursor can be used to issue subsequent queries (with the same constraints) that may return%0A   * additional results.%0A   *%0A   * %3Cp%3EA simple use case:%0A   * %3Cpre%3E %7B@code%0A   * Query%3CEntity%3E query = Query.entityQueryBuilder()%0A   *     .kind(%22Person%22)%0A   *     .filter(PropertyFilter.eq(%22favoriteFood%22, %22pizza%22))%0A   *     .build();%0A   * QueryResults%3CEntity%3E results = datastore.run(query);%0A   * // Consume some results (using results.next()) and do any other actions as necessary.%0A   * query = query.toBuilder().startCursor(results.cursorAfter()).build();%0A   * results = datastore.run(query); // now we will iterate over all entities not yet consumed%0A   * %3C/pre%3E
 %0A   */%0A 

update afterCursor javadoc