Package-level declarations

Types

Link copied to clipboard
class ArrayBuffer<T>(array: Array<T>) : MutableBuffer<T>

MutableBuffer implementation over Array.

Link copied to clipboard
interface Buffer<out T> : WithSize

A generic read-only random-access structure for both primitives and objects.

Link copied to clipboard
class BufferExpanded<T>(val origin: Buffer<T>, defaultValue: T, val offset: Int = 0, val size: Int = origin.size) : BufferView<T>

An expanded buffer that could include the whole initial buffer or its part and fills all space beyond it borders with defaultValue.

Link copied to clipboard
fun interface BufferFactory<T>

Function that produces Buffer from its size and function that supplies values.

Link copied to clipboard
class BufferSlice<T>(val origin: Buffer<T>, val offset: Int = 0, val size: Int) : BufferView<T>

A zero-copy buffer that "sees" only part of original buffer. Slice can't go beyond original buffer borders.

Link copied to clipboard
interface BufferView<T> : Buffer<T>

A buffer that wraps an original buffer

Link copied to clipboard
value class ByteBuffer(val array: ByteArray) : MutableBuffer<Byte>

Specialized MutableBuffer implementation over ByteArray.

Link copied to clipboard

Specialized MutableBuffer implementation over DoubleArray.

Link copied to clipboard
Link copied to clipboard
interface FlaggedBuffer<out T> : Buffer<T>

A buffer with flagged values.

Link copied to clipboard

A Double buffer that supports flags for each value like NaN or Missing.

Link copied to clipboard
typealias Float32 = Float
Link copied to clipboard
typealias Float64 = Double
Link copied to clipboard

Specialized MutableBuffer implementation over FloatArray.

Link copied to clipboard
typealias Int16 = Short
Link copied to clipboard
typealias Int32 = Int
Link copied to clipboard
typealias Int64 = Long
Link copied to clipboard
typealias Int8 = Byte
Link copied to clipboard
value class IntBuffer(val array: IntArray) : PrimitiveBuffer<Int>

Specialized MutableBuffer implementation over IntArray.

Link copied to clipboard
class ListBuffer<T>(val list: List<T>) : Buffer<T>

Buffer implementation over List.

Link copied to clipboard
value class LongBuffer(val array: LongArray) : PrimitiveBuffer<Long>

Specialized MutableBuffer implementation over LongArray.

Link copied to clipboard
open class MemoryBuffer<T : Any>(memory: Memory, spec: MemorySpec<T>) : Buffer<T>

A non-boxing buffer over Memory object.

Link copied to clipboard
interface MutableBuffer<T> : Buffer<T>

A generic mutable random-access structure for both primitives and objects.

Link copied to clipboard

Function that produces MutableBuffer from its size and function that supplies values.

Link copied to clipboard

MutableBuffer implementation over MutableList.

Link copied to clipboard

A mutable non-boxing buffer over Memory object.

Link copied to clipboard
class PermutedBuffer<T>(val origin: Buffer<T>, permutations: IntArray) : BufferView<T>

A BufferView that overrides indexing of the original buffer

Link copied to clipboard
class PermutedMutableBuffer<T>(val origin: MutableBuffer<T>, permutations: IntArray) : BufferView<T> , MutableBuffer<T>

A BufferView that overrides indexing of the original buffer

Link copied to clipboard
Link copied to clipboard
value class ReadOnlyBuffer<T>(val buffer: MutableBuffer<T>) : Buffer<T>

Immutable wrapper for MutableBuffer.

Link copied to clipboard
value class ShortBuffer(val array: ShortArray) : MutableBuffer<Short>

Specialized MutableBuffer implementation over ShortArray.

Link copied to clipboard
typealias UInt16 = UShort
Link copied to clipboard
typealias UInt32 = UInt
Link copied to clipboard
typealias UInt64 = ULong
Link copied to clipboard
typealias UInt8 = UByte
Link copied to clipboard

Represents flags to supply additional info about values of buffer.

Link copied to clipboard
class VirtualBuffer<out T>(val size: Int, generator: (Int) -> T) : Buffer<T>

A buffer with content calculated on-demand. The calculated content is not stored, so it is recalculated on each call. Useful when one needs single element from the buffer.

Functions

Link copied to clipboard

Returns an ArrayBuffer that wraps the original array.

Returns ByteBuffer over this array.

Returns DoubleBuffer over this array.

Returns FloatBuffer over this array.

Returns IntBuffer over this array.

Returns LongBuffer over this array.

Returns ShortBuffer over this array.

Returns an ListBuffer that wraps the original list.

Link copied to clipboard

Returns an MutableListBuffer that wraps the original list.

Link copied to clipboard

Convert this buffer to read-only buffer.

Link copied to clipboard
fun ByteBuffer(vararg bytes: Byte): ByteBuffer

Returns a new ByteBuffer of given elements.

inline fun ByteBuffer(size: Int, init: (Int) -> Byte): ByteBuffer

Creates a new ByteBuffer with the specified size, where each element is calculated by calling the specified init function.

Link copied to clipboard
fun DoubleBuffer(vararg doubles: Double): DoubleBuffer

Returns a new DoubleBuffer of given elements.

inline fun DoubleBuffer(size: Int, init: (Int) -> Double): DoubleBuffer

Creates a new DoubleBuffer with the specified size, where each element is calculated by calling the specified init function.

Link copied to clipboard
fun <T> Buffer<T>.expand(range: IntRange, defaultValue: T): BufferView<T>

Resize original buffer to a given range using given range, filling additional segments with defaultValue. Range left border could be negative to designate adding new blank segment to the beginning of the buffer

Link copied to clipboard
fun <T> Buffer<T>.first(): T
Link copied to clipboard
fun FloatBuffer(vararg floats: Float): FloatBuffer

Returns a new FloatBuffer of given elements.

inline fun FloatBuffer(size: Int, init: (Int) -> Float): FloatBuffer

Creates a new FloatBuffer with the specified size, where each element is calculated by calling the specified init function.

Link copied to clipboard
Link copied to clipboard
operator fun <T> Buffer<T>.get(index: UInt): T
Link copied to clipboard

Non-boxing access to primitive Double

Link copied to clipboard

Non-boxing access to primitive Int

Link copied to clipboard
fun <T> Buffer<T>.getOrNull(index: Int): T?

if index is in range of buffer, return the value. Otherwise, return null.

Link copied to clipboard
fun FlaggedBuffer<*>.hasFlag(index: Int, flag: ValueFlag): Boolean
Link copied to clipboard
fun IntBuffer(vararg ints: Int): IntBuffer

Returns a new IntBuffer of given elements.

inline fun IntBuffer(size: Int, init: (Int) -> Int): IntBuffer

Creates a new IntBuffer with the specified size, where each element is calculated by calling the specified init function.

Link copied to clipboard
Link copied to clipboard

The value is valid if all flags are down

Link copied to clipboard
fun <T> Buffer<T>.last(): T
Link copied to clipboard
fun LongBuffer(vararg longs: Long): LongBuffer

Returns a new LongBuffer of given elements.

inline fun LongBuffer(size: Int, init: (Int) -> Long): LongBuffer

Creates a new LongBuffer with the specified size, where each element is calculated by calling the specified init function.

Link copied to clipboard

Created a permuted view of given buffer using provided indices

Created a permuted mutable view of given buffer using provided indices

Link copied to clipboard
fun ShortBuffer(vararg shorts: Short): ShortBuffer

Returns a new ShortBuffer of given elements.

inline fun ShortBuffer(size: Int, init: (Int) -> Short): ShortBuffer

Creates a new ShortBuffer with the specified size, where each element is calculated by calling the specified init function.

Link copied to clipboard
fun <T> Buffer<T>.slice(range: IntRange): BufferView<T>

Zero-copy select a slice inside the original buffer

Link copied to clipboard

Returns a new ByteArray containing all the elements of this Buffer.

Link copied to clipboard

Returns a new DoubleArray containing all the elements of this Buffer.

Link copied to clipboard

Represent this buffer as DoubleBuffer. Does not guarantee that changes in the original buffer are reflected on this buffer.

Link copied to clipboard

Returns a new FloatArray containing all the elements of this Buffer.

Link copied to clipboard

Returns a new IntArray containing all the elements of this Buffer.

Link copied to clipboard

Returns a new LongArray containing all the elements of this Buffer.

Link copied to clipboard

Returns a new ShortArray containing all the elements of this Buffer.

Properties

Link copied to clipboard

Returns an IntRange of the valid indices for this Buffer.