Package dev.morphia.query
Class MorphiaCursor<T>
- java.lang.Object
-
- dev.morphia.query.MorphiaCursor<T>
-
- Type Parameters:
T- the original type being iterated
- All Implemented Interfaces:
MongoCursor<T>,Closeable,AutoCloseable,Iterator<T>
public class MorphiaCursor<T> extends Object implements MongoCursor<T>
- Since:
- 2.2
-
-
Constructor Summary
Constructors Constructor Description MorphiaCursor(MongoCursor<T> cursor)Creates a MorphiaCursor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()Closes the underlying cursor.ServerAddressgetServerAddress()ServerCursorgetServerCursor()booleanhasNext()Tnext()voidremove()List<T>toList()Converts this cursor to a List.TtryNext()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.mongodb.client.MongoCursor
forEachRemaining
-
-
-
-
Constructor Detail
-
MorphiaCursor
public MorphiaCursor(MongoCursor<T> cursor)
Creates a MorphiaCursor- Parameters:
cursor- the Iterator to use
-
-
Method Detail
-
close
public void close()
Closes the underlying cursor.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceMongoCursor<T>
-
hasNext
public boolean hasNext()
-
available
public int available()
- Specified by:
availablein interfaceMongoCursor<T>
-
tryNext
public T tryNext()
- Specified by:
tryNextin interfaceMongoCursor<T>
-
getServerCursor
public ServerCursor getServerCursor()
- Specified by:
getServerCursorin interfaceMongoCursor<T>
-
getServerAddress
@NonNull public ServerAddress getServerAddress()
- Specified by:
getServerAddressin interfaceMongoCursor<T>
-
-