//  print a openBitSet object
 private ArrayList<Integer> printBitSet(OpenBitSet bs) {
   ArrayList<Integer> listRes = new ArrayList<Integer>();
   System.out.print("bitSet(" + bs.capacity() + ") [");
   for (int i = 0; i < bs.capacity(); i++) {
     if (bs.get(i)) {
       listRes.add(i);
       System.out.print(i);
       System.out.print(" ");
     }
   }
   System.out.println("]");
   return listRes;
 }
 // convert an openBitSet to an array list
 private ArrayList<Integer> bitSetToArrayList(OpenBitSet bs) {
   ArrayList<Integer> listRes = new ArrayList<Integer>();
   for (int i = 0; i < bs.capacity(); i++) {
     if (bs.get(i)) {
       listRes.add(i);
     }
   }
   return listRes;
 }
Beispiel #3
0
 public void checkEqual(OpenBitSet bs, DocSet set) {
   for (int i = 0; i < bs.capacity(); i++) {
     assertEquals(bs.get(i), set.exists(i));
   }
   assertEquals(bs.cardinality(), set.size());
 }