Java Reference
In-Depth Information
public void
andNot(BitSet other)
Clears all bits in this bit set that are set in
other
. The resulting
value of a bit in this bit set is
true
only if it was originally
true
and the corresponding bit in
other
is
false
.
public void
or(BitSet other)
Logically
OR
s this bit set with
other
and changes the value of
this set to the result. The resulting value of a bit in this bit set
is
TRue
only if it was originally
true
or the corresponding bit in
other
is
TRue
.
public void
xor(BitSet other)
Logically
XOR
s this bit set with
other
and changes the value of
this set to the result. The resulting value of a bit in this bit set
is
true
only if it has a value different from the corresponding
bit in
other
.
You can also ask whether the current bit set has any
true
bits in common
with a second bit set by using the
intersects
method.
The remaining methods are
public int
cardinality()
Returns the number of bits in this bit set that are
true
.
public int
size()
Returns the number of bits actually stored in this
BitSet
. Set-
ting a bit index greater than or equal to this value may in-
crease the storage used by the set.
public int
length()