Constructor and Description |
---|
BitField(int mask)
Create a BitField instance
|
Modifier and Type | Method and Description |
---|---|
int |
clear(int holder)
Clear the bits.
(清除位。)
|
byte |
clearByte(byte holder)
Clear the bits.
(清除位。)
|
short |
clearShort(short holder)
Clear the bits.
(清除位。)
|
int |
getMask() |
int |
getRawValue(int holder)
Obtain the value for the specified BitField, unshifted
(获取指定 BitField 的值,未移位)
|
short |
getShortRawValue(short holder)
Obtain the value for the specified BitField, unshifted
(获取指定 BitField 的值,未移位)
|
short |
getShortValue(short holder)
Obtain the value for the specified BitField, appropriately shifted right, as a short.
(获取指定 BitField 的值,适当右移,作为一个短。)
|
int |
getValue(int holder)
Obtain the value for the specified BitField, appropriately shifted right.
(获取指定 BitField 的值,并适当右移。)
|
boolean |
isAllSet(int holder)
Are all of the bits set or not? This is a stricter test than isSet, in that all of the bits in a multi-bit set must be set for this method to return true
(是否所有位都已设置?这是比 isSet 更严格的测试,因为必须设置多位集合中的所有位,此方法才能返回 true)
|
boolean |
isSet(int holder)
Is the field set or not? This is most commonly used for a single-bit field, which is often used to represent a boolean value; the results of using it for a multi-bit field is to determine whether *any* of its bits are set
(字段是否设置?这最常用于单比特字段,通常用于表示布尔值;将它用于多位字段的结果是确定是否设置了*任何*位)
|
int |
set(int holder)
Set the bits.
(设置位。)
|
int |
setBoolean(int holder, boolean flag)
Set a boolean BitField
(设置一个布尔位域)
|
byte |
setByte(byte holder)
Set the bits.
(设置位。)
|
byte |
setByteBoolean(byte holder, boolean flag)
Set a boolean BitField
(设置一个布尔位域)
|
short |
setShort(short holder)
Set the bits.
(设置位。)
|
short |
setShortBoolean(short holder, boolean flag)
Set a boolean BitField
(设置一个布尔位域)
|
short |
setShortValue(short holder, short value)
Replace the bits with new values.
(用新值替换这些位。)
|
int |
setValue(int holder, int value)
Replace the bits with new values.
(用新值替换这些位。)
|
public BitField(int mask)
mask
- the mask specifying which bits apply to this BitField. Bits that are set in this mask are the bits that this BitField operates on
(mask - 指定哪些位应用于此 BitField 的掩码。此掩码中设置的位是此 BitField 操作的位)
public int getValue(int holder)
holder
- the int data containing the bits we're interested in
(holder - 包含我们感兴趣的位的 int 数据)
public short getShortValue(short holder)
holder
- the short data containing the bits we're interested in
(holder - 包含我们感兴趣的位的短数据)
public int getRawValue(int holder)
holder
- the int data containing the bits we're interested in
(holder - 包含我们感兴趣的位的 int 数据)
public short getShortRawValue(short holder)
holder
- the short data containing the bits we're interested in
(holder - 包含我们感兴趣的位的短数据)
public boolean isSet(int holder)
holder
- the int data containing the bits we're interested in
(holder - 包含我们感兴趣的位的 int 数据)
public boolean isAllSet(int holder)
holder
- the int data containing the bits we're interested in
(holder - 包含我们感兴趣的位的 int 数据)
public int setValue(int holder, int value)
holder
- the int data containing the bits we're interested in
(holder - 包含我们感兴趣的位的 int 数据)
value
- the new value for the specified bits
(value - 指定位的新值)
public short setShortValue(short holder, short value)
holder
- the short data containing the bits we're interested in
(holder - 包含我们感兴趣的位的短数据)
value
- the new value for the specified bits
(value - 指定位的新值)
public int clear(int holder)
holder
- the int data containing the bits we're interested in
(holder - 包含我们感兴趣的位的 int 数据)
public short clearShort(short holder)
holder
- the short data containing the bits we're interested in
(holder - 包含我们感兴趣的位的短数据)
public byte clearByte(byte holder)
holder
- the byte data containing the bits we're interested in
(holder - 包含我们感兴趣的位的字节数据)
public int set(int holder)
holder
- the int data containing the bits we're interested in
(holder - 包含我们感兴趣的位的 int 数据)
public short setShort(short holder)
holder
- the short data containing the bits we're interested in
(holder - 包含我们感兴趣的位的短数据)
public byte setByte(byte holder)
holder
- the byte data containing the bits we're interested in
(holder - 包含我们感兴趣的位的字节数据)
public int setBoolean(int holder, boolean flag)
holder
- the int data containing the bits we're interested in
(holder - 包含我们感兴趣的位的 int 数据)
flag
- indicating whether to set or clear the bits
(flag - 指示是否设置或清除位)
public short setShortBoolean(short holder, boolean flag)
holder
- the short data containing the bits we're interested in
(holder - 包含我们感兴趣的位的短数据)
flag
- indicating whether to set or clear the bits
(flag - 指示是否设置或清除位)
public byte setByteBoolean(byte holder, boolean flag)
holder
- the byte data containing the bits we're interested in
(holder - 包含我们感兴趣的位的字节数据)
flag
- indicating whether to set or clear the bits
(flag - 指示是否设置或清除位)
public int getMask()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.