Package java.util

Examples of java.util.BitSet.nextSetBit()


        //which requires the user to specify a larger stack size. This isn't really a problem, but it is slightly
        //annoying.
        while (!changedInstructions.isEmpty()) {
            for (int instructionIndex=changedInstructions.nextSetBit(0);
                     instructionIndex>=0;
                     instructionIndex=changedInstructions.nextSetBit(instructionIndex+1)) {

                changedInstructions.clear(instructionIndex);

                propagateRegisterToSuccessors(analyzedInstructions.valueAt(instructionIndex), registerNumber,
                        changedInstructions);
View Full Code Here


        assert analyzedInstructions.size() > 0;
        BitSet instructionsToProcess = new BitSet(instructions.size());

        addPredecessorSuccessor(startOfMethod, analyzedInstructions.valueAt(0), exceptionHandlers, instructionsToProcess);
        while (!instructionsToProcess.isEmpty()) {
            int currentInstructionIndex = instructionsToProcess.nextSetBit(0);
            instructionsToProcess.clear(currentInstructionIndex);

            AnalyzedInstruction instruction = analyzedInstructions.valueAt(currentInstructionIndex);
            Opcode instructionOpcode = instruction.instruction.getOpcode();
            int instructionCodeAddress = getInstructionAddress(instruction);
View Full Code Here

                BitSet dead = new BitSet();
                dead.or(potentiallyDeadStores);
                dead.and(potentiallyDeadStoresFromBeforeFallthrough);
                if (dead.cardinality() > 0) {
                    int register = dead.nextSetBit(0);
                    priority = HIGH_PRIORITY;
                    deadStore = LocalVariableAnnotation.getLocalVariableAnnotation(getMethod(), register, getPC() - 1, getPC());
                    bugAccumulator.accumulateBug(new BugInstance(this, "SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW",
                            priority).addClassAndMethod(this).add(deadStore), this);
                }
View Full Code Here

        for ( HierNode<T> parent : py ) {
            t.or( parent.getBitMask() );
        }

        BitSet d = singleBitDiff( t, y.getBitMask() );
        int inDex = d.nextSetBit( 0 );

        if ( inDex < 0 ) {
            propagate( y, i );
        } else {
View Full Code Here

        nextMapping = Mappings.create(MappingType.PARTIAL_FUNCTION,
            nSysFields + nFieldsLeft + nFieldsRight,
            nSysFields + nFieldsLeft + nFieldsRight);
        for (int i = 0; i < columnSets.length; i++) {
          BitSet c = columnSets[i];
          int t = c.nextSetBit(iterationIdx[i]);
          if (t < 0) {
            nextMapping = null;
            return;
          }
          nextMapping.set(columns[i], t);
View Full Code Here

        for ( HierNode<T> parent : py ) {
            t.or( parent.getBitMask() );
        }

        BitSet d = singleBitDiff( t, y.getBitMask() );
        int inDex = d.nextSetBit( 0 );

        if ( inDex < 0 ) {
            propagate( y, i );
        } else {
View Full Code Here

        for ( HierNode<T> parent : py ) {
            t.or( parent.getBitMask() );
        }

        BitSet d = singleBitDiff( t, y.getBitMask() );
        int inDex = d.nextSetBit( 0 );

//        while ( inDex >= 0 ) {
        if ( inDex < 0 ) {
            propagate( y, i );
        } else {
View Full Code Here

  public void test1(TestHarness harness)
  {
    harness.checkPoint("(int)");
    BitSet bs = new BitSet(17);
    bs.flip(11);
    harness.check(bs.nextSetBit(0), 11);
   
    boolean pass = false;
    try
    {
      bs.flip(-1);
View Full Code Here

            temp = new double[length - bits.cardinality()];
            int start = begin;  //start index from source array (i.e values)
            int dest = 0;       //dest index in destination array(i.e temp)
            int nextOne = -1;   //nextOne is the index of bit set of next one
            int bitSetPtr = 0//bitSetPtr is start index pointer of bitset
            while ((nextOne = bits.nextSetBit(bitSetPtr)) != -1) {
                final int lengthToCopy = nextOne - bitSetPtr;
                System.arraycopy(values, start, temp, dest, lengthToCopy);
                dest += lengthToCopy;
                start = begin + (bitSetPtr = bits.nextClearBit(nextOne));
            }
View Full Code Here

        assert 1 <= nth;
        assert nth <= tryToDo.cardinality();
        // now set index to the n'th true bit
        int index = -1;
        do {
          index = tryToDo.nextSetBit(index+1);
          assert index >= 0;
          nth--;
        }
        while (nth > 0);
        assert index != -1;
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.