Package java.util

Examples of java.util.BitSet.flip()


            ++i;
        }
        else if (logic == ANDNOT)
        {
            result = (BitSet) chain[i].bits(reader).clone();
            result.flip(0,reader.maxDoc());
            ++i;
        }
        else
        {
            result = new BitSet(reader.maxDoc());
View Full Code Here


            ++i;
        }
        else if (logic[0] == ANDNOT)
        {
            result = (BitSet) chain[i].bits(reader).clone();
            result.flip(0,reader.maxDoc());
            ++i;
        }
        else
        {
            result = new BitSet(reader.maxDoc());
View Full Code Here

    @Test
    public void testBitSetStoredCorrectly() {
        final int length = 20;
        final BitSet primes = new BitSet(length);
        primes.flip(2, length);
        for (int i = 0; i < length; i++) {
            if (primes.get(i)) {
                for (int j = i * 2; j < length; j += i) {
                    primes.set(j, false);
                }
View Full Code Here

            for (int i = 1; i < succUsage.size(); i++) {
                out.or(succUsage.get(i).in);
            }
            // calc out \ def == out & ~def == ~(out | def)
            BitSet def1 = (BitSet) def.clone();
            def1.flip(0, nLocals);
            out.and(def1);
            out.or(use);
            in = out;
        }
        return !(in.equals(old_in));
View Full Code Here

     * Called to coalesce a successor's usage into the current BB. Important: This should be called
     * before live variable analysis begins, because we don't bother merging this.in.
     */
    void absorb(Usage succ) {
        BitSet b = (BitSet) this.def.clone();
        b.flip(0, nLocals);
        b.and(succ.use);
        this.use.or(b);
        this.def.or(succ.def);
    }

View Full Code Here

  private static final int AVERAGE_NAME_SIZE = 2;
  private static final int FUNCTION_DEFINITION_CONSTANT_SIZE = "function".length() + "()".length();

  private static BitSet computeComplement(BitSet bitSet, int count) {
    BitSet notMergedSubset = (BitSet) bitSet.clone();
    notMergedSubset.flip(0, count);
    return notMergedSubset;
  }

  private static BitSet computeIntersection(BitSet thisSet, BitSet thatSet) {
    BitSet intersectionBitSet = (BitSet) thisSet.clone();
View Full Code Here

          idx = random().nextInt(sz);
          a.clear(idx);
          b.clear(idx);
         
          idx = random().nextInt(sz);
          a.flip(idx);
          b.flip(idx, idx+1);

          idx = random().nextInt(sz);
          a.flip(idx);
          b.flip(idx, idx+1);
View Full Code Here

          idx = random().nextInt(sz);
          a.flip(idx);
          b.flip(idx, idx+1);

          idx = random().nextInt(sz);
          a.flip(idx);
          b.flip(idx, idx+1);

          boolean val2 = b.get(idx);
          boolean val = b.getAndSet(idx);
          assertTrue(val2 == val);
View Full Code Here

      // test ranges, including possible extension
      int fromIndex, toIndex;
      fromIndex = random().nextInt(sz/2);
      toIndex = fromIndex + random().nextInt(sz - fromIndex);
      BitSet aa = (BitSet)a.clone(); aa.flip(fromIndex,toIndex);
      FixedBitSet bb = b.clone(); bb.flip(fromIndex,toIndex);

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

      fromIndex = random().nextInt(sz/2);
View Full Code Here

          idx = random().nextInt(sz);
          a.clear(idx);
          b.fastClear((long) idx);
         
          idx = random().nextInt(sz);
          a.flip(idx);
          b.fastFlip(idx);

          boolean val = b.flipAndGet(idx);
          boolean val2 = b.flipAndGet(idx);
          assertTrue(val != val2);
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.