Scala Library
|
|
scala/collection/BitSet.scala
]
abstract
class
BitSet
extends
Set[Int]
The class BitSet
provides the interface for a space-efficient
implementation of dense integer sets represented as bits in array of
integers. Bit indices are between 0..(capacity-1)
inclusive.
Method Summary | |
protected abstract def
|
arr : Array[Int] |
abstract def
|
capacity : Int |
def
|
contains (i : Int) : Boolean |
final def
|
elements
: Iterator[Int]
returns an iterator over the truth values of all bits
|
override def
|
equals
(other : Any) : Boolean
Checks if two bitsets are structurally identical.
Uses accelerated (32 x faster) check if the other set is a BitSet
|
override def
|
hashCode
: Int
Returns a hash code value for the object.
|
protected final def
|
mask (n : Int) : Int |
protected final def
|
memsize (n : Int) : Int |
protected final def
|
nbits (n : Int) : Int |
protected final def
|
offset (n : Int) : Int |
abstract def
|
size
: Int
number of bits in this bitset
|
protected override def
|
stringPrefix
: java.lang.String
Defines the prefix of this object's
toString representation. |
override def
|
subsetOf
(other : Set[Int]) : Boolean
Checks if this set is a subset of set
that .
Uses accelerated (32 x faster) check if the other set is a BitSet |
def
|
underlying : Array[Int] |
Methods inherited from Set | |
apply, isEmpty, *, **, toArray |
Methods inherited from Collection | |
toString |
Methods inherited from Iterable | |
concat, ++, map, flatMap, filter, partition, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toSeq, toStream, mkString, mkString, mkString, addString, addString, addString, copyToArray, projection, hasDefiniteSize |
Methods inherited from Function1 | |
compose, andThen |
Methods inherited from AnyRef | |
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
abstract
def
size : Int
i -
...true
if bit i
is set.abstract
def
capacity : Int
other -
...true
, iff both bitsets contain the same elements.override
def
hashCode : Int
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash
codes (o1.hashCode.equals(o2.hashCode)
) yet not be
equal (o1.equals(o2)
returns false
). A
degenerate implementation could always return 0
.
However, it is required that if two objects are equal
(o1.equals(o2)
returns true
) that they
have identical hash codes
(o1.hashCode.equals(o2.hashCode)
). Therefore, when
overriding this method, be sure to verify that the behavior is
consistent with the equals
method.
that
.
Uses accelerated (32 x faster) check if the other set is a BitSetother -
another set.true
, iff the other set is a superset of this set.n -
the number of bits to be stored.Int
cells needed to store n
bits.n -
...n
words.n -
...n -
...protected override
def
stringPrefix : java.lang.String
toString
representation.
Scala Library
|
|