MutableBitSet32¶
class MutableBitSet32 : MutableSet<Int>
MutableSet implementation that can store values in range 0..31.
To create an instance of this class, use one of the constructors, or the utility functions MutableBitSet32.of, MutableBitSet32.full and MutableBitSet32.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.
Instances of this class are not thread-safe.
See also¶
BitSet32: Immutable alternative.
Constructors¶
MutableBitSet32¶
constructor()
Creates an empty MutableBitSet32.
Creates a MutableBitSet32 that contains the specified elements.
Types¶
Companion¶
object Companion
Properties¶
size¶
Functions¶
add¶
addAll¶
open override fun addAll(elements: Collection<Int>): Boolean
clear¶
open override fun clear()
contains¶
containsAll¶
open override fun containsAll(elements: Collection<Int>): Boolean
equals¶
hashCode¶
isEmpty¶
iterator¶
open operator override fun iterator(): MutableIterator<Int>
remove¶
removeAll¶
open override fun removeAll(elements: Collection<Int>): Boolean
retainAll¶
open override fun retainAll(elements: Collection<Int>): Boolean
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