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
Clears the bit specified
fun clear(index: Int)
fun clear(range: IntRange)
fun clear(from: Int, to: Int)
Sets all bits in the BitSet to
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)
fun flip(from: Int, to: Int)
Reverses the bits from the range specified.
fun flip(range: IntRange)
Returns a hash code value for the object. The general contract of
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 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
false bits after (size - 1)-th.
fun previousClearBit(startIndex: Int): Int
Set the bit specified to the specified value.
fun set(index: Int, value: Boolean = true)
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