Skip to content

Companion

object Companion

Functions

empty

fun empty(): BitSet32

Creates an empty instance of BitSet32.

Usually, we use emptySet as a default value for empty sets. However, since BitSet32 is a value class, using it in a type declared as the supertype Set creates some boxing, which may not be wanted in some situations.

To create an empty set without boxing, use this method.

full

fun full(): BitSet32

Creates a full instance of BitSet32, which contains all elements in 0..31.

of

fun of(vararg elements: Int): BitSet32

fun of(elements: Iterable<Int>): BitSet32

Creates an instance of BitSet32 that contains the given elements.

If elements contains duplicates, they will only be present once in the resulting set (since sets cannot contain duplicates).

Throws

IllegalArgumentException

If an element is not in the range 0..31.