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 voidclose()Closes the iterator, freeing any resources that it uses.byte[]next()Returns the next record in the BTree.voidset(byte[] record)Replaces the last record returned bynext()with the specified record.
-
-
-
Method Detail
-
next
byte[] next() throws IOExceptionReturns 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 bynext()with the specified record.- Throws:
IOException- In case an I/O error occurred.
-
close
void close() throws IOExceptionCloses the iterator, freeing any resources that it uses. Once closed, the iterator will not return any more records.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- In case an I/O error occurred.
-
-