RingBuffer

class RingBuffer<T>(buffer: MutableBuffer<T?>, startIndex: Int, size: Int) : Buffer<T>

Thread-safe ring buffer

Constructors

RingBuffer
Link copied to clipboard
common
fun <T> RingBuffer(buffer: MutableBuffer<T?>, startIndex: Int = 0, size: Int = 0)

Types

Companion
Link copied to clipboard
common
object Companion

Functions

contentEquals
Link copied to clipboard
common
open fun contentEquals(other: Buffer<*>): Boolean
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
get
Link copied to clipboard
common
open operator override fun get(index: Int): T
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
isFull
Link copied to clipboard
common
fun isFull(): Boolean
iterator
Link copied to clipboard
common
open operator override fun iterator(): Iterator<T>
Iterator could provide wrong results if buffer is changed in initialization (iteration is safe)
push
Link copied to clipboard
common
suspend fun push(element: T)
snapshot
Link copied to clipboard
common
suspend fun snapshot(): Buffer<T>
A safe snapshot operation
toString
Link copied to clipboard
common
open fun toString(): String

Properties

size
Link copied to clipboard
common
open override var size: Int