Examples of nextClearBit()


Examples of java.util.BitSet.nextClearBit()

    private void testNextClearBit() {
        BitSet set = new BitSet();
        BitField field = new BitField();
        set.set(0, 640);
        field.set(0, 640, true);
        assertEquals(set.nextClearBit(0), field.nextClearBit(0));

        Random random = new Random(1);
        field = new BitField();
        field.set(0, 500, true);
        for (int i = 0; i < 100000; i++) {
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

                    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

Examples of java.util.BitSet.nextClearBit()

            boolean isKey = field.getAnnotation(TypeDeclaration.ATTR_KEY) != null;
            fieldDef.setKey( isKey );

            fieldDef.setDeclIndex( field.getIndex() );
            if (field.getIndex() < 0) {
                int freePos = occupiedPositions.nextClearBit(0);
                if (freePos < maxDeclaredPos) {
                    occupiedPositions.set(freePos);
                } else {
                    freePos = maxDeclaredPos + 1;
                }
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

                boolean isKey = field.getAnnotation(TypeDeclaration.ATTR_KEY) != null;
                fieldDef.setKey(isKey);

                fieldDef.setDeclIndex(field.getIndex());
                if (field.getIndex() < 0) {
                    int freePos = occupiedPositions.nextClearBit(0);
                    if (freePos < maxDeclaredPos) {
                        occupiedPositions.set(freePos);
                    } else {
                        freePos = maxDeclaredPos + 1;
                    }
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

        assert map.getFileSize() > minSize;
        List<BlockInfo> blocks = map.getBlocks();
        BitSet processed = new BitSet(blocks.size());
        assert size == blocks.get(blocks.size() - 1).end;
        List<DirectInputFragment> results = new ArrayList<DirectInputFragment>();
        for (int index = processed.nextClearBit(0); index < blocks.size(); index = processed.nextClearBit(index + 1)) {
            int lastIndex = index + 1;
            BlockInfo startBlock = blocks.get(index);
            assert size - startBlock.start >= minSize;
            while (blocks.get(lastIndex - 1).end - startBlock.start < minSize) {
                lastIndex++;
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

        assert map.getFileSize() > minSize;
        List<BlockInfo> blocks = map.getBlocks();
        BitSet processed = new BitSet(blocks.size());
        assert size == blocks.get(blocks.size() - 1).end;
        List<DirectInputFragment> results = new ArrayList<DirectInputFragment>();
        for (int index = processed.nextClearBit(0); index < blocks.size(); index = processed.nextClearBit(index + 1)) {
            int lastIndex = index + 1;
            BlockInfo startBlock = blocks.get(index);
            assert size - startBlock.start >= minSize;
            while (blocks.get(lastIndex - 1).end - startBlock.start < minSize) {
                lastIndex++;
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

      BitSet termflag = new BitSet(termsInIndex);
      for (int j=0; j<nClauses; j++) {
        int tnum;
        // don't pick same clause twice
        tnum = random.nextInt(termsInIndex);
        if (termflag.get(tnum)) tnum=termflag.nextClearBit(tnum);
        if (tnum<0 || tnum>=termsInIndex) tnum=termflag.nextClearBit(0);
        termflag.set(tnum);
        Query tq = new TermQuery(terms[tnum]);
        bq.add(tq, BooleanClause.Occur.MUST);
      }
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

      for (int j=0; j<nClauses; j++) {
        int tnum;
        // don't pick same clause twice
        tnum = random.nextInt(termsInIndex);
        if (termflag.get(tnum)) tnum=termflag.nextClearBit(tnum);
        if (tnum<0 || tnum>=termsInIndex) tnum=termflag.nextClearBit(0);
        termflag.set(tnum);
        Query tq = new TermQuery(terms[tnum]);
        bq.add(tq, BooleanClause.Occur.MUST);
      }
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

      BitSet termflag = new BitSet(termsInIndex);
      for (int j=0; j<nClauses; j++) {
        int tnum;
        // don't pick same clause twice
        tnum = random.nextInt(termsInIndex);
        if (termflag.get(tnum)) tnum=termflag.nextClearBit(tnum);
        if (tnum<0 || tnum>=25) tnum=termflag.nextClearBit(0);
        termflag.set(tnum);
        Query tq = new TermQuery(terms[tnum]);
        bq.add(tq, BooleanClause.Occur.MUST);
      } // inner
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

      for (int j=0; j<nClauses; j++) {
        int tnum;
        // don't pick same clause twice
        tnum = random.nextInt(termsInIndex);
        if (termflag.get(tnum)) tnum=termflag.nextClearBit(tnum);
        if (tnum<0 || tnum>=25) tnum=termflag.nextClearBit(0);
        termflag.set(tnum);
        Query tq = new TermQuery(terms[tnum]);
        bq.add(tq, BooleanClause.Occur.MUST);
      } // inner
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.