Mutable

abstract class Mutable : PackedInts.Reader

A packed integer array that can be modified.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
abstract val bitsPerValue: Int
Link copied to clipboard

Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).

Functions

Link copied to clipboard
open fun clear()

Sets all values to 0.

Link copied to clipboard
open fun fill(fromIndex: Int, toIndex: Int, val: Long)

Fill the mutable from fromIndex (inclusive) to toIndex (exclusive) with val.

Link copied to clipboard
abstract fun get(index: Int): Long

Get the long at the given index. Behavior is undefined for out-of-range indices.

open fun get(index: Int, arr: LongArray, off: Int, len: Int): Int

Bulk get: read at least one and at most len longs starting from index * into arr[off:off+len] and return the actual number of values that have been read.

Link copied to clipboard
abstract fun ramBytesUsed(): Long

Return the memory usage of this object in bytes. Negative values are illegal.

Link copied to clipboard
abstract fun set(index: Int, value: Long)

Set the value at the given index in the array.

open fun set(index: Int, arr: LongArray, off: Int, len: Int): Int

Bulk set: set at least one and at most len longs starting at off in arr into this mutable, starting at index. Returns the actual number of values that have been set.

Link copied to clipboard
abstract fun size(): Int