Returns the number of bits that are set to 1.
Example:
var bits = new BitSet (8); bits.set (0); bits.set (3); bits.set (7); assert (bits.cardinality () == 3);
the number of set bits.