Package java.util

Examples of java.util.BitSet.clear()


                if (random.nextBoolean()) {
                    bits.set(idx);
                    set.set(idx);
                } else {
                    bits.clear(idx);
                    set.clear(idx);
                }
            } else {
                assertEquals(set.get(idx), bits.get(idx));
                assertEquals(set.nextClearBit(idx), bits.nextClearBit(idx));
                assertEquals(set.length(), bits.length());
View Full Code Here


          fail("failed: "+doc+" not in expected set");
          return;
        }
        else
        {
          bs.clear(doc);
        }
      }
      if (bs.cardinality()>0)
      {
        fail("failed: leftover cardinatity: "+bs.cardinality());
View Full Code Here

                {
                    modifiedState.set(i);
                }
                else
                {
                    modifiedState.clear(i);
                }
            }
            state[3] = modifiedState;

            return state;
View Full Code Here

                {
                    loadedState.set(i);
                }
                else
                {
                    loadedState.clear(i);
                }
            }
            state[2] = loadedState;

            // Modified fields
View Full Code Here

                {
                    modifiedState.set(i);
                }
                else
                {
                    modifiedState.clear(i);
                }
            }
            state[3] = modifiedState;

            return state;
View Full Code Here

          idx = rand.nextInt(sz);
          a.set(idx);
          b.fastSet(idx);
          idx = rand.nextInt(sz);
          a.clear(idx);
          b.fastClear(idx);
          idx = rand.nextInt(sz);
          a.flip(idx);
          b.fastFlip(idx);
View Full Code Here

      doIterate(aa,bb, mode);   // a problem here is from flip or doIterate

      fromIndex = rand.nextInt(sz+80);
      toIndex = fromIndex + rand.nextInt((sz>>1)+1);
      aa = (BitSet)a.clone(); aa.clear(fromIndex,toIndex);
      bb = (OpenBitSet)b.clone(); bb.clear(fromIndex,toIndex);

      doNextSetBit(aa,bb)// a problem here is from clear() or nextSetBit

      fromIndex = rand.nextInt(sz+80);
View Full Code Here

    // test one doc
    BitSet set = new BitSet(numBits);
    set.set(0); // 0 first
    T copy = copyOf(set, numBits);
    assertEquals(numBits, set, copy);
    set.clear(0);
    set.set(random().nextInt(numBits));
    copy = copyOf(set, numBits); // then random index
    assertEquals(numBits, set, copy);
    // test regular increments
    for (int inc = 2; inc < 1000; inc += _TestUtil.nextInt(random(), 1, 100)) {
View Full Code Here

          idx = random.nextInt(sz);
          a.set(idx);
          b.fastSet(idx);
          idx = random.nextInt(sz);
          a.clear(idx);
          b.fastClear(idx);
          idx = random.nextInt(sz);
          a.flip(idx);
          b.fastFlip(idx);
View Full Code Here

      doIterate(aa,bb, mode);   // a problem here is from flip or doIterate

      fromIndex = random.nextInt(sz+80);
      toIndex = fromIndex + random.nextInt((sz>>1)+1);
      aa = (BitSet)a.clone(); aa.clear(fromIndex,toIndex);
      bb = (OpenBitSet)b.clone(); bb.clear(fromIndex,toIndex);

      doNextSetBit(aa,bb)// a problem here is from clear() or nextSetBit
      doPrevSetBit(aa,bb);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.