class BitSet

A vector of bits growing if necessary and allowing one to set/clear/read bits from it by a bit index.

True if this BitSet contains no bits set to true.

val isEmpty: Boolean

Returns an index of the last bit that has `true`

value. Returns -1 if the set is empty.

val lastTrueIndex: Int

Actual number of bits available in the set. All bits with indices >= size assumed to be 0

var size: Int

Performs a logical and operation over corresponding bits of this and another BitSets. The result is saved in this BitSet.

fun and(another: BitSet)

Performs a logical and + not operations over corresponding bits of this and another BitSets. The result is saved in this BitSet.

fun andNot(another: BitSet)

Clears the bit specified

fun clear(index: Int)

fun clear(range: IntRange)

Clears the bits with indices between from (inclusive) and to (exclusive) to the specified value.

fun clear(from: Int, to: Int)

Sets all bits in the BitSet to `false`

.

fun clear()

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

fun equals(other: Any?): Boolean

Reverses the bit specified.

fun flip(index: Int)

Reverses the bits with indices between from (inclusive) and to (exclusive).

fun flip(from: Int, to: Int)

Reverses the bits from the range specified.

fun flip(range: IntRange)

Returns a value of a bit with the index specified.

operator fun get(index: Int): Boolean

Returns a hash code value for the object. The general contract of `hashCode`

is:

fun hashCode(): Int

Returns true if the specified BitSet has any bits set to true that are also set to true in this BitSet.

fun intersects(another: BitSet): Boolean

Returns an index of a next bit which value is `false`

after startIndex (inclusive). Returns size if there is no such bits between startIndex and size - 1 assuming that the set has an infinite sequence of `false`

bits after (size - 1)-th.

fun nextClearBit(startIndex: Int = 0): Int

Returns an index of a next bit which value is `true`

after startIndex (inclusive). Returns -1 if there is no such bits after startIndex.

fun nextSetBit(startIndex: Int = 0): Int

Performs a logical or operation over corresponding bits of this and another BitSets. The result is saved in this BitSet.

fun or(another: BitSet)

Returns the biggest index of a bit which value is lookFor before startIndex (inclusive). Returns -1 if there is no such bits before startIndex. If startIndex >= size returns -1

fun previousBit(startIndex: Int, lookFor: Boolean): Int

Returns the biggest index of a bit which value is `false`

before startIndex (inclusive). Returns -1 if there is no such bits before startIndex or if startIndex == -1. If startIndex >= size will return startIndex assuming that the set has an infinite sequence of `false`

bits after (size - 1)-th.

fun previousClearBit(startIndex: Int): Int

Returns the biggest index of a bit which value is `true`

before startIndex (inclusive). Returns -1 if there is no such bits before startIndex or if startIndex == -1. If startIndex >= size will search from (size - 1)-th bit.

fun previousSetBit(startIndex: Int): Int

Set the bit specified to the specified value.

fun set(index: Int, value: Boolean = true)

Sets the bits with indices between from (inclusive) and to (exclusive) to the specified value.

fun set(from: Int, to: Int, value: Boolean = true)

Sets the bits from the range specified to the specified value.

fun set(range: IntRange, value: Boolean = true)

Returns a string representation of the object.

fun toString(): String

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors

Licensed under the Apache License, Version 2.0.

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native/-bit-set/index.html