set

fun set(bitIndex: Int)

Sets the bit at the specified index to true.

Since

1.0

Parameters

bitIndex

a bit index

Throws

if the specified index is negative


operator fun set(bitIndex: Int, value: Boolean)

Sets the bit at the specified index to the specified value.

Since

1.4

Parameters

bitIndex

a bit index

value

a boolean value to set

Throws

if the specified index is negative


fun set(fromIndex: Int, toIndex: Int)

Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to true.

Since

1.4

Parameters

fromIndex

index of the first bit to be set

toIndex

index after the last bit to be set

Throws

if fromIndex is negative, or toIndex is negative, or fromIndex is larger than toIndex


fun set(fromIndex: Int, toIndex: Int, value: Boolean)

Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to the specified value.

Since

1.4

Parameters

fromIndex

index of the first bit to be set

toIndex

index after the last bit to be set

value

value to set the selected bits to

Throws

if fromIndex is negative, or toIndex is negative, or fromIndex is larger than toIndex