Returns the index of the first set bit starting at the index specified.
-1 is returned if there are no more set bits.
10024
long nextSetBit(long index) {
		// Depends on the ghost bits being clear!
		assert index >= 0 && index < numBits : "index=" + index + ", numBits=" + numBits;
		int i = (int) (index >> 6);
		long word = bits[i] >> index; // skip all the bits to the right of index

		if (word != 0) {
			return index + Long.numberOfTrailingZeros(word);
		}

		while (++i < numWords) {
			word = bits[i];
			if (word != 0) {
				return (i << 6) + Long.numberOfTrailingZeros(word);
			}
		}

		return -1;
	}
694576
public int indexOfRelativeIndex(int relativeIndex) {
    for (int i = 0; i < relativeIndices.length; i++) {
      if (relativeIndices[i] == relativeIndex) {
        return i;
      }
    }
    return -1;
  }
847086
@Override
    public int getInt(final int index) {
        boundsCheck(index, Bits.INT_SIZE_IN_BYTES);

        int bits = MEM.getInt(byteArray, addressOffset + index);
        if (NATIVE_BYTE_ORDER != PROTOCOL_BYTE_ORDER) {
            bits = Integer.reverseBytes(bits);
        }

        return bits;
    }
961823
private static byte _getByte(int startIndex, BitSetStrictLength set)
			throws AsnException {

		int count = 8;
		byte data = 0;

//		if (set.length() - 1 < startIndex) {
//			throw new AsnException();
//		}

		while (count > 0) {
			if (set.length() - 1 < startIndex) {
				break;
			} else {
				boolean lit = set.get(startIndex);
				if (lit) {
					data |= (0x01 << (count - 1));
				}

				startIndex++;
				count--;
			}

		}
		return data;
	}
105610
public static boolean bitGet(MemorySegment segment, int baseOffset, int index) {
		int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
		byte current = segment.get(offset);
		return (current & (1 << (index & BIT_BYTE_INDEX_MASK))) != 0;
	}
522066
public static int indexFrom(String s,String chars)
    {
        for (int i=0;i<s.length();i++)
           if (chars.indexOf(s.charAt(i))>=0)
              return i;
        return -1;
    }
1073162
def bit(index, name, attrs = {})
      if index.is_a?(Range)
        msb = index.first
        lsb = index.last
        msb, lsb = lsb, msb if lsb > msb
        pos = lsb
        bits = (msb - lsb).abs + 1
      elsif index.is_a?(Numeric)
        pos = index
        bits = 1
      else
        fail 'No valid index supplied when defining a register bit!'
      end

      # Traynor, this could be more elegant
      # its just a dirty way to make the value of the
      # key in @new_reg_atts hash array (ie name) tie to
      # a value that is an array of hashes describing
      # data for each scrambled bit
      attrs = attrs.merge(pos: pos, bits: bits)
      temparray = []
      if @new_reg_attrs[name].nil?
        @new_reg_attrs[name] = attrs
      else
        if @new_reg_attrs[name].is_a? Hash
          temparray = temparray.push(@new_reg_attrs[name])
        else
          temparray = @new_reg_attrs[name]
        end
        temparray = temparray.push(attrs)
        # added the sort so that the order the registers bits is described is not important
        @new_reg_attrs[name] = temparray.sort { |a, b| b[:pos] <=> a[:pos] }

      end
    end
253650
public int indexOf(final char ch, int startIndex) {
        startIndex = (startIndex < 0 ? 0 : startIndex);
        if (startIndex >= size) {
            return -1;
        }
        final char[] thisBuf = buffer;
        for (int i = startIndex; i < size; i++) {
            if (thisBuf[i] == ch) {
                return i;
            }
        }
        return -1;
    }
569398
def get_bin_index(self, value):
        """"""
        if value == self.max_value:
            return self.num_bins - 1
        return int((value - self.min_value) / self.bin_size)
115062
def _get_start_end(parts, index=7):
    
    start = parts[1]
    end = [x.split("=")[-1] for x in parts[index].split(";") if x.startswith("END=")]
    if end:
        end = end[0]
        return start, end
    return None, None
1051281
public int nextIndex() {
		int index = -1;
		for (int i = 0; i <  _values.length && index == -1; ++i) {
			if (Double.isNaN(_values[i])) {
				index = i;
			}
		}

		return index;
	}
218625
private int findFirst(CharSequence input, int beginIndex, int rewindIndex) {
        int first = -1;
        boolean atomBoundary = true;
        for (int i = beginIndex; i >= rewindIndex; i--) {
            char c = input.charAt(i);
            if (localAtomAllowed(c)) {
                first = i;
                atomBoundary = false;
            } else if (c == '.') {
                if (atomBoundary) {
                    break;
                }
                atomBoundary = true;
            } else {
                break;
            }
        }
        return first;
    }
550617
private int findFirstDifferingBit(String key1, String key2) {
        int bit = 0;

        while (keyMapper.isSet(bit, key1) == keyMapper.isSet(bit, key2)) {
            bit++;
        }
        return bit;
    }
998880
public int getEvictionIndex() {
    /*
     * If the table has been shrunk then it's possible for the clock-hand to
     * point past the end of the table.  We cannot allow the initial-hand to
     * be equal to this otherwise we may never be able to terminate this loop.
     */
    if (clockHand >= hashtable.capacity()) {
      clockHand = 0;
    }

    int initialHand = clockHand;
    int loops = 0;
    while (true) {
      if ((clockHand += ENTRY_SIZE) + STATUS >= hashtable.capacity()) {
        clockHand = 0;
      }

      int hand = hashtable.get(clockHand + STATUS);

      if (evictable(hand) && ((hand & PRESENT_CLOCK) == 0)) {
        return clockHand;
      } else if ((hand & PRESENT_CLOCK) == PRESENT_CLOCK) {
        hashtable.put(clockHand + STATUS, hand & ~PRESENT_CLOCK);
      }

      if (initialHand == clockHand && ++loops == 2) {
        return -1;
      }
    }
  }
311894
def get_header_index(self, hdrclass, startidx=0):
        '''
        
        '''
        for hdridx in range(startidx, len(self._headers)):
            if isinstance(self._headers[hdridx], hdrclass):
                return hdridx
        return -1
475020
boolean get(int bitIndex) {
        int wordIndex = wordIndex(bitIndex);
        long bitMask = 1L << bitIndex;
        return (words[wordIndex] & bitMask) != 0;
    }
1156552
def get_bin_index(self, value):
        """"""
        if value == self.max_value:
            return self.num_bins - 1

        return int(self.C * log(value / self.min_value))