BitSet
is a bit misleading.
+ ///
+ /// It is implemented by a bit vector, but its equally possible to see
+ /// it as set of non-negative integer; each integer in the set is
+ /// represented by a set bit at the corresponding index. The size of
+ /// this structure is determined by the highest integer in the set.
+ ///
+ /// You can union, intersect and build (symmetric) remainders, by
+ /// invoking the logical operations and, or, andNot, resp. xor.
+ ///
+ /// This implementation is NOT synchronized against concurrent access from
+ /// multiple threads. Specifically, if one thread is reading from a bitset
+ /// while another thread is simultaneously modifying it, the results are
+ /// undefined.
+ ///
+ /// author Jochen Hoenicke
+ /// author Tom Tromey (tromey@cygnus.com)
+ /// author Eric Blake (ebb9@email.byu.edu)
+ /// status updated to 1.4
+ /// 0
to nbits-1
.
+ /// set
. This means it builds the intersection
+ /// of the two sets. The result is stored into this bit set.
+ /// bs
. This means it
+ /// selects every element in the first set, that isn't in the
+ /// second set. The result is stored into this bit set and is
+ /// effectively the set difference of the two.
+ /// pos
from this set. That is
+ /// the corresponding bit is cleared. If the index is not in the set,
+ /// this method does nothing.
+ /// obj
is a bit set that contains
+ /// exactly the same elements as this bit set, otherwise false.
+ /// bitIndex
is in this bit
+ /// set, otherwise false.
+ /// BitSet
composed of a range of bits from
+ /// this one.
+ /// bits
, in such a manner that
+ /// bit k
is set in the BitSet (for non-negative values
+ /// of k
) if and only if
+ ///
+ /// ((k/64) < bits.length)
+ /// && ((bits[k/64] & (1L << (bit % 64))) != 0)
+ ///
+ ///
+ /// Then the following definition of the GetHashCode method
+ /// would be a correct implementation of the actual algorithm:
+ ///
+ /// public override int GetHashCode() + /// { + /// long h = 1234; + /// for (int i = bits.length-1; i >= 0; i--) + /// { + /// h ^= bits[i] * (i + 1); + /// } + /// + /// return (int)((h >> 32) ^ h); + /// }+ /// + /// Note that the hash code values changes, if the set is changed. + ///
for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) + /// { + /// // operate on i here + /// } + ///+ ///
set
. This means it builds the union
+ /// of the two sets. The result is stored into this bit set, which
+ /// grows as necessary.
+ /// bitIndex
to this set. That is
+ /// the corresponding bit is set to true. If the index was already in
+ /// the set, this method does nothing. The size of this structure
+ /// is automatically increased as necessary.
+ /// set
. This means it builds the symmetric
+ /// remainder of the two sets (the elements that are in one set,
+ /// but not in the other). The result is stored into this bit set,
+ /// which grows as necessary.
+ /// Any text string can be converted to UTF-8 bytes and encoded as a byte mode segment.
+ ///