ResultT - The type of documents the cursor containspublic class MongoCursor<ResultT> extends Object implements Iterator<ResultT>, Closeable
Iterator containing an additional
tryNext() method for convenience.
An application should ensure that a cursor is closed in all circumstances, e.g. using a try-with-resources statement.
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
hasNext() |
ResultT |
next() |
ResultT |
tryNext()
A special
next() case that returns the next document if available or null. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removepublic ResultT tryNext()
next() case that returns the next document if available or null.Task containing the next document if available or null.public void close()
close in interface Closeableclose in interface AutoCloseable