EventLog

interface EventLog

An EventLog is a high-performance mutable log of serialized events, which are concatenated after each other in some contiguous data structures.

See also

a mutable extension of this collection.

Types

Link copied to clipboard
interface OnLogUpdateListener

A listener which may be used to observe some changed performed on an EventLog.

Functions

Link copied to clipboard
abstract fun acknowledged(): EventIdentifierArray

Returns an EventIdentifierArray with all the acknowledgements that have been issued by this MutableEventLog. This EventIdentifierArray only contains one EventIdentifier per SiteIdentifier.

Link copied to clipboard
open operator fun contains(id: EventIdentifier): Boolean

Returns true if the event with the event with the given EventIdentifier is included in the EventLog, or if any event with the same SiteIdentifier and a higher SequenceNumber has already been integrated.

abstract fun contains(seqno: SequenceNumber, site: SiteIdentifier): Boolean

Returns true if the event with the event with the given SiteIdentifier is included in the EventLog, or if any event with the same SiteIdentifier and a higher SequenceNumber has already been integrated.

Link copied to clipboard
abstract operator fun iterator(): EventIterator

Returns an EventIterator. The retrieved EventIterator will start at the beginning of the EventLog, and should not be used anymore if the underlying EventLog is modified.

abstract fun iterator(site: SiteIdentifier): EventIterator

Returns an EventIterator specific to a single site. The retrieved EventIterator will start at the beginning of the EventLog, and should not be used anymore if the underlying EventLog is modified.

Link copied to clipboard
abstract fun iteratorAtEnd(): EventIterator

Returns an EventIterator. The retrieved EventIterator will start at the end of the EventLog, and should not be used anymore if the underlying EventLog is modified.

abstract fun iteratorAtEnd(site: SiteIdentifier): EventIterator

Returns an EventIterator specific to a single site. The retrieved EventIterator will start at the end of the EventLog, and should not be used anymore if the underlying EventLog is modified.

Link copied to clipboard
abstract fun registerLogUpdateListener(listener: EventLog.OnLogUpdateListener)

Registers the provided OnLogUpdateListener to this EventLog.

Link copied to clipboard
abstract fun unregisterLogUpdateListener(listener: EventLog.OnLogUpdateListener)

Unregisters the provided OnLogUpdateListener from this EventLog.

Properties

Link copied to clipboard
abstract val size: Int

Returns the count of events in the EventLog.

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
fun EventLog.copyOf(): EventLog

Returns a copy of the current EventLog.

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

Returns true iff there are no events in the EventLog.

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

Returns true iff there are some events in the EventLog.

Link copied to clipboard
fun EventLog.toList(): List<Event>

Transforms this EventLog to a List of Event.

Link copied to clipboard
fun EventLog.toMutableEventLog(): MutableEventLog

Returns a MutableEventLog copy of this EventLog.