Interface RecordIterator

  • All Superinterfaces:
    AutoCloseable, Closeable

    public interface RecordIterator
    extends Closeable
    An iterator that iterates over records, for example those in a BTree.
    Author:
    Arjohn Kampman
    See Also:
    BTree
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Closes the iterator, freeing any resources that it uses.
      byte[] next()
      Returns the next record in the BTree.
      void set​(byte[] record)
      Replaces the last record returned by next() with the specified record.
    • Method Detail

      • next

        byte[] next()
             throws IOException
        Returns the next record in the BTree.
        Returns:
        A record that is stored in the BTree, or null if all records have been returned.
        Throws:
        IOException - In case an I/O error occurred.
      • set

        void set​(byte[] record)
          throws IOException
        Replaces the last record returned by next() with the specified record.
        Throws:
        IOException - In case an I/O error occurred.
      • close

        void close()
            throws IOException
        Closes the iterator, freeing any resources that it uses. Once closed, the iterator will not return any more records.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Throws:
        IOException - In case an I/O error occurred.