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)
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 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
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
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
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
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
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.