Class BitUtil

java.lang.Object
com.intellij.util.BitUtil

public final class BitUtil extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    assertOneBitMask(int mask)
     
    static byte
    clear(byte value, byte mask)
     
    static int
    clear(int value, int mask)
     
    static long
    clear(long value, long mask)
     
    static boolean
    isSet(byte value, byte mask)
     
    static boolean
    isSet(int value, int mask)
     
    static boolean
    isSet(long flags, long mask)
     
    static byte
    set(byte value, byte mask, boolean setBit)
     
    static int
    set(int value, int mask, boolean setBit)
     
    static long
    set(long value, long mask, boolean setBit)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BitUtil

      public BitUtil()
  • Method Details

    • isSet

      @Contract(pure=true) public static boolean isSet(byte value, byte mask)
    • isSet

      @Contract(pure=true) public static boolean isSet(int value, int mask)
    • isSet

      @Contract(pure=true) public static boolean isSet(long flags, long mask)
    • set

      @Contract(pure=true) public static byte set(byte value, byte mask, boolean setBit)
      Returns:
      value with the bit corresponding to the mask set (if setBit is true) or cleared (if setBit is false)
    • set

      @Contract(pure=true) public static int set(int value, int mask, boolean setBit)
      Returns:
      value with the bit corresponding to the mask set (if setBit is true) or cleared (if setBit is false)
    • set

      @Contract(pure=true) public static long set(long value, long mask, boolean setBit)
      Returns:
      value with the bit corresponding to the mask set (if setBit is true) or cleared (if setBit is false)
    • clear

      @Contract(pure=true) public static byte clear(byte value, byte mask)
    • clear

      @Contract(pure=true) public static int clear(int value, int mask)
    • clear

      @Contract(pure=true) public static long clear(long value, long mask)
    • assertOneBitMask

      public static void assertOneBitMask(int mask)