Пример #1
0
 //  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;
 }
Пример #2
0
 // 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;
 }
Пример #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());
 }