org.apache.spark.util.collection
Return the number of bits set to true in this BitSet.
Return the value of the bit with the specified index.
Return the value of the bit with the specified index. The value is true if the bit with the index is currently set in this BitSet; otherwise, the result is false.
the bit index
the value of the bit with the specified index
Returns the index of the first bit that is set to true that occurs on or after the specified starting index.
Returns the index of the first bit that is set to true that occurs on or after the specified starting index. If no such bit exists then -1 is returned.
To iterate over the true bits in a BitSet, use the following loop:
for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i+1)) { // operate on index i here }
the index to start checking from (inclusive)
the index of the next set bit, or -1 if there is no such bit
Sets the bit at the specified index to true.
Sets the bit at the specified index to true.
the bit index
A simple, fixed-size bit set implementation. This implementation is fast because it avoids safety/bound checking.