Concrete Mutable Collection ClassesConcurrent MapsMutable BitsetsContents

Mutable Bitsets

A mutable bit of type mutable.BitSet set is just like an immutable one, except that it is modified in place. Mutable bit sets are slightly more efficient at updating than immutable ones, because they don't have to copy around Longs that haven't changed.

scala> val bits = scala.collection.mutable.BitSet.empty
bits: scala.collection.mutable.BitSet = BitSet()
scala> bits += 1
res49: bits.type = BitSet(1)
scala> bits += 3
res50: bits.type = BitSet(1, 3)
scala> bits
res51: scala.collection.mutable.BitSet = BitSet(1, 3)

Next: Arrays


Concrete Mutable Collection ClassesConcurrent MapsMutable BitsetsContents