public abstract class CursorEntityIterator extends Object implements EntityIterator
Constructor and Description |
---|
CursorEntityIterator(Cursor cursor)
Constructor that makes initializes the cursor such that the iterator points to the
first Entity, if there are any.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Indicates that this iterator is no longer needed and that any associated resources
may be released (such as a SQLite cursor).
|
abstract Entity |
getEntityAndIncrementCursor(Cursor cursor)
Returns the entity that the cursor is currently pointing to.
|
boolean |
hasNext()
Returns whether there are more elements to iterate, i.e.
|
Entity |
next()
Returns the next object in the iteration, i.e.
|
void |
remove()
Removes the last object returned by
next from the collection. |
void |
reset()
Reset the iterator back to the beginning.
|
public CursorEntityIterator(Cursor cursor)
cursor
- the cursor that contains the rows that make up the entitiespublic abstract Entity getEntityAndIncrementCursor(Cursor cursor) throws RemoteException
cursor
- the cursor that contains the entity rowsRemoteException
- if a RemoteException is caught while attempting to build the Entitypublic final boolean hasNext()
hasNext
in interface Iterator<Entity>
true
if there are more elements, false
otherwise.Iterator.next()
public Entity next()
next
in interface Iterator<Entity>
NoSuchElementException
- if there are no more elements.Iterator.hasNext()
public void remove()
Iterator
next
from the collection.
This method can only be called once between each call to next
.public final void reset()
EntityIterator
reset
in interface EntityIterator
public final void close()
close
in interface EntityIterator