EventIterator

interface EventIterator : ListIterator<Event>

An interface defining an iterator over a MutableEventLog. Efficient, allocation-free methods for iteration are available, as well as an implementation of ListIterator which returns Event objects on each iteration.

Functions

Link copied to clipboard
abstract operator override fun hasNext(): Boolean
Link copied to clipboard
abstract fun hasPrevious(): Boolean
Link copied to clipboard
abstract fun moveNext()

Moves the EventIterator to the next event, without allocations.

Link copied to clipboard
abstract fun movePrevious()

Moves the EventIterator to the previous event, without allocations.

Link copied to clipboard
abstract operator override fun next(): Event
Link copied to clipboard
abstract fun nextIndex(): Int
Link copied to clipboard
abstract fun previous(): Event
Link copied to clipboard
abstract fun previousIndex(): Int

Properties

Link copied to clipboard
abstract val nextEvent: MutableByteGapBuffer

The body of the next event, between nextFrom and nextUntil.

Link copied to clipboard
open val nextEventIdentifier: EventIdentifier

The EventIdentifier of the next event.

Link copied to clipboard
abstract val nextFrom: Int

The start of the next event body.

Link copied to clipboard
abstract val nextSeqno: SequenceNumber

The SequenceNumber of the next event.

Link copied to clipboard
abstract val nextSite: SiteIdentifier

The SiteIdentifier of the next event.

Link copied to clipboard
abstract val nextUntil: Int

The end (non-inclusive) of next event body.

Link copied to clipboard
abstract val previousEvent: MutableByteGapBuffer

The body of the previous event, between previousFrom and previousUntil.

Link copied to clipboard
open val previousEventIdentifier: EventIdentifier

The EventIdentifier of the previous event.

Link copied to clipboard
abstract val previousFrom: Int

The start of the previous event body.

Link copied to clipboard
abstract val previousSeqno: SequenceNumber

The SequenceNumber of the previous event.

Link copied to clipboard
abstract val previousSite: SiteIdentifier

The SiteIdentifier of the previous event.

Link copied to clipboard
abstract val previousUntil: Int

The end (non-inclusive) of previous event body.

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
fun EventIterator.isEmpty(): Boolean

Returns true iff the EventIterator is empty.

Link copied to clipboard
fun EventIterator.isNotEmpty(): Boolean

Returns true iff the EventIterator is not empty.

Link copied to clipboard
inline fun EventIterator.movePreviousWhile(predicate: EventIterator.() -> Boolean)

Moves the EventIterator to the previous, while the predicate is valid.

Link copied to clipboard
fun EventIterator.moveToEnd()

Moves the EventIterator to its end, without allocations.

Link copied to clipboard
fun EventIterator.moveToStart()

Moves the EventIterator to its start, without allocations.