BitSet32¶
Immutable Set implementation that can store values in range 0..31.
To create an instance of this class, see BitSet32.of, BitSet32.full and BitSet32.empty.
Instances of this class have the following particularities:
-
Operations on a single element execute in
O(1). -
Memory usage is
O(1): exactly 32 bits when unboxed.
See also¶
MutableBitSet32: Mutable alternative.
Types¶
Companion¶
object Companion
Properties¶
size¶
Functions¶
contains¶
containsAll¶
open override fun containsAll(elements: Collection<Int>): Boolean
isEmpty¶
iterator¶
toEnumSet¶
Copies a regular Set into a set optimized for enumerations.
Depending on the enumeration size, different implementations may be returned.
Example
toMutableEnumSet¶
inline fun <E : Enum<E>> Set<E>.toMutableEnumSet(): MutableSet<E>
Copies a regular Set into a mutable set optimized for enumerations.
Depending on the enumeration size, different implementations may be returned.
Example
toMutableSet¶
fun toMutableSet(): MutableBitSet32