Package java.util

Examples of java.util.BitSet.nextClearBit()


        // if the index is larger than bs.size(), nextClearBit should return
        // index
        assertEquals("nextClearBit() returned the wrong value", 513, bs
                .nextClearBit(513));
        assertEquals("nextClearBit() returned the wrong value", 800, bs
                .nextClearBit(800));
    }

    /**
     * @tests java.util.BitSet#isEmpty()
View Full Code Here


                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

      BitSet termflag = new BitSet(termsInIndex);
      for (int j=0; j<nClauses; j++) {
        int tnum;
        // don't pick same clause twice
        tnum = r.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

      for (int j=0; j<nClauses; j++) {
        int tnum;
        // don't pick same clause twice
        tnum = r.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

      BitSet termflag = new BitSet(termsInIndex);
      for (int j=0; j<nClauses; j++) {
        int tnum;
        // don't pick same clause twice
        tnum = r.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

      for (int j=0; j<nClauses; j++) {
        int tnum;
        // don't pick same clause twice
        tnum = r.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

                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

                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

                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

        assertEquals("nextClearBit() returned the wrong value", 193, bs
                .nextClearBit(130));
        assertEquals("nextClearBit() returned the wrong value", 193, bs
                .nextClearBit(191));

        assertEquals("nextClearBit() returned the wrong value", 193, bs
                .nextClearBit(192));
        assertEquals("nextClearBit() returned the wrong value", 193, bs
                .nextClearBit(193));
        assertEquals("nextClearBit() returned the wrong value", 450, bs
                .nextClearBit(194));
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.