scala.collection.mutable

class BitSet

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

@serializable

@SerialVersionUID(8483111450368547763L)

class BitSet(protected val elems : Array[Long])
extends Set[Int] with BitSet with BitSetLike[BitSet] with SetLike[Int, BitSet]
A class for mutable bitsets.
Since
1
Additional Constructor Summary
def this : BitSet
def this (initSize : Int) : BitSet
Method Summary
def += (elem : Int) : BitSet
Adds a new element to the set.
def -= (elem : Int) : BitSet
Removes a single element from a set.
override def add (elem : Int) : Boolean
Adds element to bitset,
override def clear : Unit
Removes all elements from the set. After this operation is completed, the set will be empty.
override def clone : BitSet
This method creates and returns a copy of the receiver object.
override def empty : BitSet
protected def fromArray (words : Array[Long]) : BitSet
Create a new set of this kind from an array of longs
protected def nwords : Int
The number of words (each with 64 bits) making up the set
override def remove (elem : Int) : Boolean
Removes element from bitset.
def toImmutable : BitSet
protected def word (idx : Int) : Long
The words at index `idx', or 0L if outside the range of the set
Methods inherited from BitSetLike
size, iterator, foreach, |, &, &~, ^, contains, subSet, addString, stringPrefix
Methods inherited from Set
companion
Methods inherited from SetLike
newBuilder, update, retain, result, +, +, ++, ++, -, -, --, --, <<
Methods inherited from Shrinkable
-=, --=, --=
Methods inherited from Builder
sizeHint, mapResult
Methods inherited from Growable
+=, ++=, ++=
Methods inherited from SetLike
isEmpty, apply, intersect, &, **, union, |, diff, &~, subsetOf, toString, hashCode, equals
Methods inherited from Function1
compose, andThen
Methods inherited from IterableLike
thisCollection, toCollection, elements, forall, exists, find, foldRight, reduceRight, toIterable, head, take, slice, takeWhile, takeRight, dropRight, copyToArray, zip, zipAll, zipWithIndex, sameElements, toStream, canEqual, view, view, first, firstOption, projection
Methods inherited from GenericTraversableTemplate
genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableLike
repr, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, partialMap, remove, partition, groupBy, count, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, tail, last, lastOption, init, drop, dropWhile, span, splitAt, copyToBuffer, copyToArray, toArray, toList, toSeq, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, withFilter
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(initSize : Int) : BitSet

def this : BitSet

Method Details
override def empty : BitSet
Overrides
BitSet.empty, BitSetLike.empty

protected def nwords : Int
The number of words (each with 64 bits) making up the set
Overrides
BitSetLike.nwords

protected def word(idx : Int) : Long
The words at index `idx', or 0L if outside the range of the set
Precondition
idx >= 0
Overrides
BitSetLike.word

protected def fromArray(words : Array[Long]) : BitSet
Create a new set of this kind from an array of longs
Overrides
BitSetLike.fromArray

override def add(elem : Int) : Boolean
Adds element to bitset,
Returns
element was already present.
Overrides
SetLike.add

override def remove(elem : Int) : Boolean
Removes element from bitset.
Returns
element was already present.
Overrides
SetLike.remove

def +=(elem : Int) : BitSet
Adds a new element to the set.
Parameters
elem - the element to be added
Overrides
SetLike.+=

def -=(elem : Int) : BitSet
Removes a single element from a set.
Parameters
elem - The element to be removed.
Overrides
SetLike.-=

override def clear : Unit
Removes all elements from the set. After this operation is completed, the set will be empty.
Overrides
SetLike.clear

def toImmutable : BitSet

override def clone : BitSet
This method creates and returns a copy of the receiver object.

The default implementation of the clone method is platform dependent.

Returns
a copy of the receiver object.

Overrides
SetLike.clone