ReadOnlyBuffer

value class ReadOnlyBuffer<T>(buffer: MutableBuffer<T>) : Buffer<T>

Immutable wrapper for MutableBuffer.

Parameters

T

the type of elements contained in the buffer.

Constructors

ReadOnlyBuffer
Link copied to clipboard
common
fun <T> ReadOnlyBuffer(buffer: MutableBuffer<T>)
the type of elements contained in the buffer.

Functions

get
Link copied to clipboard
common
open operator override fun get(index: Int): T
Gets element at given index.
iterator
Link copied to clipboard
common
open operator override fun iterator(): Iterator<T>
Iterates over all elements.

Properties

buffer
Link copied to clipboard
common
val buffer: MutableBuffer<T>
The underlying buffer.
size
Link copied to clipboard
common
open override val size: Int
The size of this buffer.

Sources

common source
Link copied to clipboard