public class BrowseIterator
extends Object
This helper takes care of chaining API requests and calling back the handler block with the results, until: - the end of the index has been reached; - an error has been encountered; - or the user cancelled the iteration.
| Modifier and Type | Class and Description |
|---|---|
static interface |
BrowseIterator.BrowseIteratorHandler
Listener for
BrowseIterator. |
| Constructor and Description |
|---|
BrowseIterator(Index index,
Query query,
BrowseIterator.BrowseIteratorHandler handler)
Construct a new browse iterator.
|
BrowseIterator(Index index,
Query query,
RequestOptions requestOptions,
BrowseIterator.BrowseIteratorHandler handler)
Construct a new browse iterator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancel the iteration.
|
boolean |
hasNext()
Determine if there is more content to be browsed.
|
void |
start()
Start the iteration.
|
public BrowseIterator(@NonNull
Index index,
@NonNull
Query query,
@NonNull
BrowseIterator.BrowseIteratorHandler handler)
index - The index to be browsed.query - The query used to filter the results.handler - Handler called for each batch of results.public BrowseIterator(@NonNull
Index index,
@NonNull
Query query,
@Nullable
RequestOptions requestOptions,
@NonNull
BrowseIterator.BrowseIteratorHandler handler)
index - The index to be browsed.query - The query used to filter the results.requestOptions - Request-specific options.handler - Handler called for each batch of results.public void start()
public void cancel()
public boolean hasNext()