This class implements a vector of bits that grows as needed. Each
component of the bit set has a
boolean value. The
bits of a
BitSet are indexed by nonnegative integers.
Individual indexed bits can be examined, set, or cleared. One
BitSet may be used to modify the contents of another
BitSet through logical AND, logical inclusive OR, and
logical exclusive OR operations.
By default, all bits in the set initially have the value
Every bit set has a current size, which is the number of bits of space currently in use by the bit set. Note that the size is related to the implementation of a bit set, so it may change with implementation. The length of a bit set relates to logical length of a bit set and is defined independently of implementation.
Unless otherwise noted, passing a null parameter to any of the
methods in a
BitSet will result in a
BitSet is not safe for multithreaded use without
Public Constructor Summary
Creates a new bit set.
Creates a bit set whose initial size is large enough to explicitly represent bits with indices in the range
Public Method Summary
Returns the number of bits set to
clear(int fromIndex, int toIndex)
Sets the bits from the specified
Sets the bit specified by the index to
Sets all of the bits in this BitSet to