org.activiti.engine.impl.util
类 BitMaskUtil

java.lang.Object
  继承者 org.activiti.engine.impl.util.BitMaskUtil

public class BitMaskUtil
extends Object

Util class for manipulating bit-flag in ints. Currently, only 8-bits are supporten, but can be extended to use all 31 bits in the integer (1st of 32 bits is used for sign).

作者:
Frederik Heremans

构造方法摘要
BitMaskUtil()
           
 
方法摘要
static boolean isBitOn(int value, int bitNumber)
          Check if the bit is set to '1'
static int setBit(int value, int bitNumber, boolean bitValue)
          Set bit to '0' or '1' in the given int.
static int setBitOff(int value, int bitNumber)
          Set bit to '0' in the given int.
static int setBitOn(int value, int bitNumber)
          Set bit to '1' in the given int.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

BitMaskUtil

public BitMaskUtil()
方法详细信息

setBitOn

public static int setBitOn(int value,
                           int bitNumber)
Set bit to '1' in the given int.

参数:
current - integer value
bitNumber - number of the bit to set to '1' (right first bit starting at 1).

setBitOff

public static int setBitOff(int value,
                            int bitNumber)
Set bit to '0' in the given int.

参数:
current - integer value
bitNumber - number of the bit to set to '0' (right first bit starting at 1).

isBitOn

public static boolean isBitOn(int value,
                              int bitNumber)
Check if the bit is set to '1'

参数:
value - integer to check bit
number - of bit to check (right first bit starting at 1)

setBit

public static int setBit(int value,
                         int bitNumber,
                         boolean bitValue)
Set bit to '0' or '1' in the given int.

参数:
current - integer value
bitNumber - number of the bit to set to '0' or '1' (right first bit starting at 1).
bitValue - if true, bit set to '1'. If false, '0'.


Copyright © 2013 Alfresco. All rights reserved.