T - The type of documents the cursor contains@NotThreadSafe @Deprecated public interface BatchCursor<T> extends java.util.Iterator<java.util.List<T>>, java.io.Closeable
next method will return the first batch, and subsequent calls will trigger a request to get the next batch
of results. Clients can control the batch size by setting the batchSize property between calls to next.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Deprecated.
|
int |
getBatchSize()
Deprecated.
Gets the batch size to use when requesting the next batch.
|
ServerAddress |
getServerAddress()
Deprecated.
Returns the server address
|
ServerCursor |
getServerCursor()
Deprecated.
Returns the server cursor
|
boolean |
hasNext()
Deprecated.
Returns true if another batch of results exists.
|
java.util.List<T> |
next()
Deprecated.
Returns the next batch of results.
|
void |
setBatchSize(int batchSize)
Deprecated.
Sets the batch size to use when requesting the next batch.
|
java.util.List<T> |
tryNext()
Deprecated.
A special
next() case that returns the next batch if available or null. |
void close()
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableboolean hasNext()
hasNext in interface java.util.Iterator<java.util.List<T>>java.util.List<T> next()
next in interface java.util.Iterator<java.util.List<T>>java.util.NoSuchElementException - if no next batch existsvoid setBatchSize(int batchSize)
batchSize - the non-negative batch size. 0 means to use the server default.int getBatchSize()
java.util.List<T> tryNext()
next() case that returns the next batch if available or null.
Tailable cursors are an example where this is useful. A call to tryNext() may return null, but in the future calling
tryNext() would return a new batch if a document had been added to the capped collection.
ServerCursor getServerCursor()
ServerAddress getServerAddress()
Copyright © 2010 - 2023 Adobe. All Rights Reserved