Package org.javarosa.core.util
Interface Iterator<E>
- All Known Subinterfaces:
IStorageIterator<E>
- All Known Implementing Classes:
DummyStorageIterator
public interface Iterator<E>
Interface for iterating through a set of records from an IStorageUtility
-
Method Summary
Modifier and Type Method Description booleanhasMore()Return whether the set has more records to iterate throughintnextID()Return the ID of the next record in the set.EnextRecord()Return the next record in the set.intnumRecords()Number of records in the setintpeekID()Return the ID of the next record in the set without advancing the iterator.
-
Method Details
-
numRecords
int numRecords()Number of records in the set- Returns:
- number of records
-
peekID
int peekID()Return the ID of the next record in the set without advancing the iterator.- Returns:
- ID of next record
- Throws:
StorageModifiedException- if the underlying StorageUtility has been modified since this iterator was createdIllegalStateException- if all records have already been iterated through
-
nextID
int nextID()Return the ID of the next record in the set. Advance the iteration cursor by one.- Returns:
- ID of next record
- Throws:
StorageModifiedException- if the underlying StorageUtility has been modified since this iterator was createdIllegalStateException- if all records have already been iterated through
-
nextRecord
E nextRecord()Return the next record in the set. Advance the iteration cursor by one.- Returns:
- object representation of next record
- Throws:
IllegalStateException- if all records have already been iterated through
-
hasMore
boolean hasMore()Return whether the set has more records to iterate through- Returns:
- true if there are more records to iterate though.
-