|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.core.internal.catalog.ResultCursor<T>
public class ResultCursor<T extends PageableResultType>
A cursor for iterating over search results obtained from arcgis.com A "pageable" search performed on arcgis.com may yield a large number of results. By default, only the first ten result values are returned. The ResultCursor allows clients to retrieve results in batches and fetches more results from the server when necessary.
Constructor Summary | |
---|---|
protected |
ResultCursor(Catalog catalog,
String reqUrl,
HashMap<String,String> params,
org.codehaus.jackson.JsonParser response,
Class<T> clazz,
com.esri.core.internal.catalog.Filter filter)
|
Method Summary | |
---|---|
int |
available()
Returns the number of elements that the ResultCursor can return without sending a request to the Server. |
void |
close()
Closes the cursor |
int |
getCount()
Returns the total number of elements returned from the server that can be iterated over. |
List<T> |
getElements(int startIndex,
int endIndex)
Returns a range of elements specified by startIndex and endIndex , inclusively. |
boolean |
hasMoreElements()
Tells if there are more elements that can be iterated over. |
protected void |
init(org.codehaus.jackson.JsonParser response)
|
T |
nextElement()
Returns the next element, fetching more elements from the server, if necessary. |
List<T> |
nextTenElements()
Returns the next ten elements, fetching more elements from the server if necessary. |
void |
reset()
Resets the cursor |
void |
seek(int pos)
Seeks the cursor to the specified position. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ResultCursor(Catalog catalog, String reqUrl, HashMap<String,String> params, org.codehaus.jackson.JsonParser response, Class<T> clazz, com.esri.core.internal.catalog.Filter filter)
Method Detail |
---|
protected void init(org.codehaus.jackson.JsonParser response)
public int getCount()
public void reset()
public boolean hasMoreElements()
hasMoreElements
in interface Enumeration<T extends PageableResultType>
public T nextElement()
nextElement
in interface Enumeration<T extends PageableResultType>
public List<T> nextTenElements()
public int available()
public void seek(int pos) throws IndexOutOfBoundsException
pos
- the position that the cursor should seek to
IndexOutOfBoundsException
public List<T> getElements(int startIndex, int endIndex)
startIndex
and endIndex
, inclusively.
A sublist of an internal list maintained by the ResultCursor is returned. Invoking getElements(0,3)
will
return a total of 4 elements.
If endIndex
is greater than the size of the internal list held within the ResultCursor
and there are more results to be
fetched, then this method will fetch more results from the server and then return. If endIndex
exceeds the total number of
results the server can return then it returns getCount()
- startIndex - 1
number of elements.
Invoking this method does not alter the position of an internal cursor that is employed for iterating elements using
the nextElement()
and nextTenElements()
methods.
startIndex
- the startIndexendIndex
- the endIndex
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |