E - public class ObjectIterator<E>
extends java.lang.Object
implements java.lang.Iterable<E>, java.util.Iterator<E>
DBCursorss. Basically it returns java
objects rather than DBObjects.| Constructor and Description |
|---|
ObjectIterator(com.mongodb.DBCursor cursor,
ObjectMapper objectMapper,
java.lang.Class<E> clazz)
Creates the
ObjectIterator. |
| Modifier and Type | Method and Description |
|---|---|
E |
current() |
com.mongodb.DBCursor |
getDBCursor()
Returns the underlying
DBCursor. |
boolean |
hasNext() |
java.util.Iterator<E> |
iterator()
For for loops.
|
E |
next() |
java.util.List<E> |
readAll()
Reads all of the objects behind this cursor
and returns them in a
List. |
java.util.List<E> |
readAll(java.util.List<E> ret)
Reads all of the objects behind this cursor
and returns them in a
List. |
void |
remove()
DBCursor.remove(). |
public ObjectIterator(com.mongodb.DBCursor cursor,
ObjectMapper objectMapper,
java.lang.Class<E> clazz)
ObjectIterator.cursor - the cursor to wrapobjectMapper - the ObjectMapper to useclazz - the class we're returningpublic java.util.Iterator<E> iterator()
iterator in interface java.lang.Iterable<E>public java.util.List<E> readAll(java.util.List<E> ret)
List.ret - the list to read the objects intoList of objects.public java.util.List<E> readAll()
List.List of objects.public boolean hasNext()
hasNext in interface java.util.Iterator<E>public E current()
public void remove()
DBCursor.remove().remove in interface java.util.Iterator<E>public com.mongodb.DBCursor getDBCursor()
DBCursor.DBCursorCopyright © 2013. All Rights Reserved.