Java Bit Set setBit(int mask, int bit, boolean value)

Here you can find the source of setBit(int mask, int bit, boolean value)

Description

set Bit

License

LGPL

Declaration

public static int setBit(int mask, int bit, boolean value) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static int setBit(int mask, int bit, boolean value) {
        mask |= (value ? 1 : 0) << bit;
        return mask;
    }// w  ww  . j a va 2 s  . com
}

Related

  1. setBit(int flag, int i)
  2. setBit(int flags, int bit)
  3. setBit(int i, int bit, boolean enabled)
  4. setBit(int i, int bit, boolean state)
  5. setBit(int integer, int bit)
  6. setBit(int n, int bitPosition)
  7. setBit(int position, boolean value, int meta)
  8. setBit(int position, byte[] array)
  9. setBit(int value, int bit)