src/java/org/apache/cassandra/utils/obs/OpenBitSet.java
/** Returns the index of the first set bit starting at the index specified.
   *  -1 is returned if there are no more set bits.
   */
Returns the index of the first set bit starting at the index specified.
-1 is returned if there are no more set bits.
Returns the index of the first set bit starting at the index specified . - 1 is returned if there are no more set bits .
public int nextSetBit(int index) {
    int i = index>>6;
    if (i>=wlen) return -1;
    int subIndex = index & 0x3f;      
    long word = bits[i / PAGE_SIZE][ i % PAGE_SIZE] >> subIndex;  
    if (word!=0) {
      return (i<<6) + subIndex + BitUtil.ntz(word);
    }
    while(++i < wlen) {
      word = bits[i / PAGE_SIZE][i % PAGE_SIZE];
      if (word!=0) return (i<<6) + BitUtil.ntz(word);
    }
    return -1;
  }
public int nextSetBit ( int index ) { int i = index >> 6 ; if ( i >= wlen ) return - 1 ; int subIndex = index & 0x3f ; long word = bits [ i / PAGE_SIZE ] [ i % PAGE_SIZE ] >> subIndex ; if ( word != 0 ) { return ( i << 6 ) + subIndex + BitUtil . ntz ( word ) ; } while ( ++ i < wlen ) { word = bits [ i / PAGE_SIZE ] [ i % PAGE_SIZE ] ; if ( word != 0 ) return ( i << 6 ) + BitUtil . ntz ( word ) ; } return - 1 ; }
Returns the index of the first set bit starting at the index specified.
Returns the index of the first set bit starting at the index specified .
// index within the word // skip all the bits to the right of index