Sets the bit at the specified index to <code>true</code>.

@param     bitIndex   a bit index.
@exception IndexOutOfBoundsException if the specified index is negative.
@since     JDK1.0
169287
public void set(int bitIndex) {
		if (bitIndex < 0)
			throw new IndexOutOfBoundsException("bitIndex < 0: " + bitIndex);

		int wordIndex = wordIndex(bitIndex);
		expandTo(wordIndex);

		words[wordIndex] |= (1L << bitIndex); // Restores invariants

		checkInvariants();
	}
79428
public long readBits(int bit) throws IOException, JPEGMarkerException {
        if (bit < 0) {
            throw new IllegalArgumentException("bit must be greater than zero");
        }

        int i = 0, v = 0;
        while (i != bit) {
            i++;
            v = (v << 1) | readBit();
        }

        return v;
    }
712669
public void set(int x, int y) {
    int offset = y * rowSize + (x / 32);
    bits[offset] |= 1 << (x & 0x1f);
  }
127622
private void set(int position, boolean val) {
        // enlarge bitString if necessary
        if (position >= bitString.length) {
            boolean[] tmp = new boolean[position+1];
            System.arraycopy(bitString, 0, tmp, 0, bitString.length);
            bitString = tmp;
        }
        bitString[position] = val;
    }
948722
public void setInt(int index, int value)
    {
        checkIndexLength(index, SizeOf.SIZE_OF_INT);
        unsafe.putInt(base, address + index, value);
    }
558172
public void setValue(char[] chars, int offset, int len) {
		checkNotNull(chars);
		if (offset < 0 || len < 0 || offset > chars.length - len) {
			throw new IndexOutOfBoundsException();
		}

		ensureSize(len);
		System.arraycopy(chars, offset, this.value, 0, len);
		this.len = len;
		this.hashCode = 0;
	}
439500
public static void set(long[] bits, int pos) {
    int offset = pos >> LONG_SHIFT;
    if (offset >= bits.length)
      throw new IndexOutOfBoundsException();
    bits[offset] |= 1L << pos;
  }
716244
public int nextSetBit(int index) {
        int i = index>>6;
        if (i>=wlen) return -1;
        int subIndex = index & 0x3f;      // index within the word
        long word = bits[i] >> subIndex;  // skip all the bits to the right of index

        if (word!=0) {
            return (i<<6) + subIndex + Long.numberOfTrailingZeros(word);
        }

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

        return -1;
    }
25236
public int setInt(
        @DoNotSub final int index,
        final int element)
    {
        checkIndex(index);

        final int previous = elements[index];
        elements[index] = element;

        return previous;
    }
1061985
void flip(long index) {
		assert index >= 0 && index < numBits : "index=" + index + " numBits=" + numBits;
		int wordNum = (int) (index >> 6); // div 64
		long bitmask = 1L << index; // mod 64 is implicit
		bits[wordNum] ^= bitmask;
	}
1341373
public static boolean isBitOn(int value, int bitNumber) {
    if (bitNumber <= 0 || bitNumber > 8) {
      throw new IllegalArgumentException("Only bits 1 through 8 are supported");
    }

    return ((value & MASKS[bitNumber - 1]) == MASKS[bitNumber - 1]);
  }
160552
public void set(BitArray ba) {
        if (ba.size != this.size)
            throw new IllegalArgumentException();
        for (int i = 0; i < this.data.length; ++i)
            this.data[i] = ba.data[i];
    }
184612
public void set(int i, boolean value) {
		int idx = i / 8;
		if(idx >= bb.limit()) {
			throw new IndexOutOfBoundsException();
		}
		int bit = 7 - (i % 8);
		if(value) {
			bb.put(idx, (byte) (bb.get(idx) | MASKS[bit]));
		} else {
			bb.put(idx,(byte) (bb.get(idx) & MASKSR[bit]));
		}
	}
905658
public void set(long index) throws IOException {
        long pos = index >> 3;
        try {
            lock().acquireUpgradableLock();
            int value = mFile.read(pos);
            int newValue;
            if (value <= 0) {
                newValue = (0x00000080 >> (index & 7));
            }
            else {
                newValue = value | (0x00000080 >> (index & 7));
            }
            if (newValue != value) {
                mFile.write(pos, newValue);
            }
        }
        catch (InterruptedException e) {
            throw new InterruptedIOException();
        }
        finally {
            lock().releaseLock();
        }
    }
1136697
public boolean flip(int bitIndex)
    {
        int wordIndex = wordIndex(bitIndex);
        words[wordIndex] ^= (1L << bitIndex);
        
        return ((words[wordIndex] & (1L << bitIndex)) != 0);
    }
494029
public void set(int idx) {
    idx -= _bitoff;
    assert (idx >= 0 && idx < _nbits): "Must have "+_bitoff+" <= idx <= " + (_bitoff+_nbits-1) + ": " + idx;
    _val[_byteoff+(idx >> 3)] |= ((byte)1 << (idx & 7));
  }
521820
public void writeBit(final int bit)
		throws EncodingException
	{

		if (bit != 0 && bit != 1) {
			throw ErrorFactory.createEncodingException(
					ErrorKeys.DIFFTOOL_ENCODING_VALUE_OUT_OF_RANGE,
					"bit value out of range: " + bit);
		}

		this.buffer |= bit << (7 - this.bufferLength);
		this.bufferLength++;

		if (bufferLength == 8) {

			write(buffer);

			this.bufferLength = 0;
			this.buffer = 0;
		}
	}