package org.blaazinsoftware.centaur.service;

import com.google.appengine.api.datastore.Cursor;
import com.google.appengine.api.datastore.Index;
import com.google.appengine.api.datastore.QueryResultList;

import java.util.ArrayList;
import java.util.List;

/**
 * Implementation of the <code>QueryResultList</code> to allow for paged results
 *
 * @author Randy May
 *         Date: 14-10-30
 */
public class ResultList <T> extends ArrayList<T> implements QueryResultList<T> {
    private List<Index> indexList;
    private Cursor cursor;

    /**
     * Get the indexes used to perform the query.
     *
     * @return      - <code>Index</code>
     */
    public List<Index> getIndexList() {
        return indexList;
    }

    /**
     * Set the List of Indexes
     *
     * @param indexList     - List of Indexes
     */
    protected void setIndexList(List<Index> indexList) {
        this.indexList = indexList;
    }

    /**
     * Gets a Cursor that points to the result immediately after the last one in this list.
     *
     * @return              - <code>Cursor</code>
     */
    public Cursor getCursor() {
        return cursor;
    }

    /**
     * Gets a Cursor that points to the result immediately after the last one in this list.
     *
     * @param cursor        - <code>Cursor</code>
     */
    protected void setCursor(Cursor cursor) {
        this.cursor = cursor;
    }
}

@@ -533,16 +533,301 @@
 ursor;%0A%0A
+    /**%0A     * Default Constructor%0A     */%0A    public ResultList() %7B%0A%0A    %7D%0A%0A    /**%0A     * Constructor for cloning a ResultList object%0A     *%0A     * @param cursor        - %3Ccode%3ECursor%3C/code%3E to use%0A     */%0A    public ResultList (Cursor cursor) %7B%0A        this.cursor = cursor;%0A    %7D%0A%0A
     /**%0A
@@ -899,24 +899,32 @@
 return      
+        
 - %3Ccode%3EInde

Add a constructor to create a copy of a ResultList object.