scala.collection.mutable
class BitSet

[source: `scala/collection/mutable/BitSet.scala`]

@serializable
`` `class` BitSet(initSize : Int)
  `extends` BitSet `with` Set[Int]

  The class `BitSet` implements mutable, resizable Bit sets

Author
  Burak Emir, Nikolay Mihaylov
Version
  1.1
Parameters
  `initSize: -` initial size in bits

Additional Constructor Summary
`def` | this : BitSet default constructor, initial size of 512 bits.

Value Summary
`protected var` | arr : Array[Int]
`var` | capacity : Int
`var` | size : Int number of bits in this bitset

Method Summary
`def` | += (i : Int) : Unit Sets `i-th` bit to true. No restriction on `i`
`def` | -= (i : Int) : Unit Clears the `i`-th bit.
`override def` | clear : Unit Clears all bits of the set.
`override def` | clone : BitSet Return a clone of this set.
`def` | ensureCapacity (n : Int) : Unit Ensures that this bitset can store at least `n` bits.
`def` | toImmutable : BitSet

Methods inherited from Set
update, +=, ++=, ++=, +, +, ++, ++, incl, -=, --=, --=, -, -, --, --, excl, intersect, retain, <<, readOnly

Methods inherited from BitSet
contains, elements, equals, hashCode, subsetOf, memsize, nbits, offset, mask, underlying, toArray, stringPrefix

Methods inherited from Set
apply, isEmpty

Methods inherited from Collection
toString, equalWith

Methods inherited from Iterable
concat, ++, map, flatMap, filter, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, mkString, mkString, addString, addString, copyToArray, projection, hasDefiniteSize

Methods inherited from Function1
compose, andThen

Methods inherited from AnyRef
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized

Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf

Additional Constructor Details

`` `def` this : BitSet

  default constructor, initial size of 512 bits.

Overrides
  BitSet.this

Value Details

`` `var` size : Int

  number of bits in this bitset

Overrides
  BitSet.size

`` `var` capacity : Int

Overrides
  BitSet.capacity

`protected` `var` arr : Array[Int]

Overrides
  BitSet.arr

Method Details

`` `def` ensureCapacity(n : Int) : Unit

  Ensures that this bitset can store at least `n` bits.

Parameters
  `n -` ...

`` `def` +=(i : Int) : Unit

  Sets `i-th` bit to true. No restriction on `i`

Overrides
  Set.+=

`` `def` -=(i : Int) : Unit

  Clears the `i`-th bit.

Parameters
  `i -` the `i`-th element of the bit set.

Overrides
  Set.-=

`override` `def` clear : Unit

  Clears all bits of the set.

Overrides
  Set.clear

`` `def` toImmutable : BitSet

`override` `def` clone : BitSet

  Return a clone of this set.

Returns
  a set with the same elements.

Overrides
  Set.clone