Interface EntryJournal.Reader
- All Superinterfaces:
AutoCloseable
- Enclosing interface:
EntryJournal
A reader-side interface to log entries being stored in this journal.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
@Nullable EntryJournal.JournalEntry
Returns the nextEntryJournal.JournalEntry
, ornull
.long
Returns Returns thejournalIndex
, guaranteed to be positive.void
resetToRead
(long nextJournalIndex) Reset this reader so it attempts to read the entry at specifiedjournalIndex
.
-
Method Details
-
nextJournalIndex
long nextJournalIndex()Returns Returns thejournalIndex
, guaranteed to be positive.- Returns:
- Returns the
journalIndex
, guaranteed to be positive
-
nextEntry
Returns the nextEntryJournal.JournalEntry
, ornull
.- Returns:
- the next
EntryJournal.JournalEntry
, ornull
- Throws:
IOException
- if an I/O error occurs
-
resetToRead
Reset this reader so it attempts to read the entry at specifiedjournalIndex
.- Parameters:
nextJournalIndex
- the nextjournalIndex
to read, must be positive- Throws:
IOException
- if an I/O error occurs
-
close
void close()- Specified by:
close
in interfaceAutoCloseable
-