MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / printBitSet

Method printBitSet

collectiontopics/Bits.java:9–15  ·  view source on GitHub ↗
(BitSet b)

Source from the content-addressed store, hash-verified

7
8public class Bits {
9 public static void printBitSet(BitSet b) {
10 System.out.println("bits: " + b);
11 StringBuilder bbits = new StringBuilder();
12 for(int j = 0; j < b.size() ; j++)
13 bbits.append(b.get(j) ? "1" : "0");
14 System.out.println("bit pattern: " + bbits);
15 }
16 public static void main(String[] args) {
17 Random rand = new Random(47);
18 // Take the LSB of nextInt():

Callers 1

mainMethod · 0.95

Calls 3

appendMethod · 0.80
getMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected