public boolean getBit(int index)
    {
        assertValidIndex(index);
        int word = index / WORD_LENGTH;
        int offset = index % WORD_LENGTH;
        return (data[word] & (1 << offset)) != 0;
    }
public boolean getBit ( int index ) { assertValidIndex ( index ) ; int word = index / WORD_LENGTH ; int offset = index % WORD_LENGTH ; return ( data [ word ] & ( 1 << offset ) ) != 0 ; }
Returns the bit at the specified index.
@param index The index of the bit to look-up (0 is the least-significant bit).
@return A boolean indicating whether the bit is set or not.
@throws IndexOutOfBoundsException If the specified index is not a bit
position in this bit string.