set

operator fun set(i: Int, value: Boolean)(source)

Sets the boolean value at the specified index.

Parameters

i

The index to set the value at.

value

The boolean value to set.

See also

Throws

If the index is out of bounds.


fun set(from: Int, to: Int, value: Boolean)(source)

Sets all bits in the inclusive range [from, to] to value.

No-op when from > to.

Parameters

from

Inclusive start index.

to

Inclusive end index.

value

The boolean value to set in the range.

Throws

If from < 0 or to >= size.


fun set(range: IntRange, value: Boolean)(source)

Sets all bits in the given inclusive range to value.

No-op for IntRange.EMPTY.

Parameters

range

Inclusive range of indices to set.

value

The boolean value to set in the range.

Throws

If range.first < 0 or range.last >= size for non-empty ranges.