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
    boolean hasMore()
    Return whether the set has more records to iterate through
    int nextID()
    Return the ID of the next record in the set.
    E nextRecord()
    Return the next record in the set.
    int numRecords()
    Number of records in the set
    int peekID()
    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 created
      IllegalStateException - 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 created
      IllegalStateException - 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.