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. whether the
iterator is positioned in front of an element.
|
Entity |
next()
Returns the next object in the iteration, i.e. returns the element in
front of the iterator and advances the iterator by one position.
|
void |
remove()
Removes from the underlying collection the last element returned
by this iterator (optional operation).
|
void |
reset()
Reset the iterator back to the beginning.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
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
Iterator.next()
. The behavior of an iterator
is unspecified if the underlying collection is modified while the
iteration is in progress in any way other than by calling this
method.public final void reset()
EntityIterator
reset
in interface EntityIterator
public final void close()
close
in interface EntityIterator