private final class ListCollectionsOperation.ProjectingBatchCursor extends java.lang.Object implements BatchCursor<T>
Modifier and Type | Field and Description |
---|---|
private BatchCursor<BsonDocument> |
delegate |
Modifier | Constructor and Description |
---|---|
private |
ProjectingBatchCursor(BatchCursor<BsonDocument> delegate) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
getBatchSize()
Gets the batch size to use when requesting the next batch.
|
ServerAddress |
getServerAddress()
Returns the server address
|
ServerCursor |
getServerCursor()
Returns the server cursor
|
boolean |
hasNext()
Returns true if another batch of results exists.
|
java.util.List<T> |
next()
Returns the next batch of results.
|
void |
remove() |
void |
setBatchSize(int batchSize)
Sets the batch size to use when requesting the next batch.
|
java.util.List<T> |
tryNext()
A special
next() case that returns the next batch if available or null. |
private final BatchCursor<BsonDocument> delegate
private ProjectingBatchCursor(BatchCursor<BsonDocument> delegate)
public void remove()
remove
in interface java.util.Iterator<java.util.List<T>>
public void close()
close
in interface BatchCursor<T>
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public boolean hasNext()
BatchCursor
hasNext
in interface BatchCursor<T>
hasNext
in interface java.util.Iterator<java.util.List<T>>
public java.util.List<T> next()
BatchCursor
next
in interface BatchCursor<T>
next
in interface java.util.Iterator<java.util.List<T>>
public void setBatchSize(int batchSize)
BatchCursor
setBatchSize
in interface BatchCursor<T>
batchSize
- the non-negative batch size. 0 means to use the server default.public int getBatchSize()
BatchCursor
getBatchSize
in interface BatchCursor<T>
public java.util.List<T> tryNext()
BatchCursor
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.
tryNext
in interface BatchCursor<T>
public ServerCursor getServerCursor()
BatchCursor
getServerCursor
in interface BatchCursor<T>
public ServerAddress getServerAddress()
BatchCursor
getServerAddress
in interface BatchCursor<T>