| java.lang.Object org.apache.poi.util.BitField
BitField | public class BitField (Code) | | Manage operations dealing with bit-mapped fields.
author: Marc Johnson (mjohnson at apache dot org) author: Andrew C. Oliver (acoliver at apache dot org) |
Constructor Summary | |
public | BitField(int mask) Create a BitField instance
Parameters: mask - the mask specifying which bits apply to thisBitField. |
Method Summary | |
public int | clear(int holder) Clear the bits. | public byte | clearByte(byte holder) Clear the bits. | public short | clearShort(short holder) Clear the bits. | public int | getRawValue(int holder) | public short | getShortRawValue(short holder) | public short | getShortValue(short holder) Obtain the value for the specified BitField, appropriately
shifted right, as a short. | public int | getValue(int holder) Obtain the value for the specified BitField, appropriately
shifted right. | public boolean | isAllSet(int holder) | public boolean | isSet(int holder) | public int | set(int holder) Set the bits. | public int | setBoolean(int holder, boolean flag) | public byte | setByte(byte holder) Set the bits. | public byte | setByteBoolean(byte holder, boolean flag) | public short | setShort(short holder) Set the bits. | public short | setShortBoolean(short holder, boolean flag) | public short | setShortValue(short holder, short value) Replace the bits with new values. | public int | setValue(int holder, int value) Replace the bits with new values. |
BitField | public BitField(int mask)(Code) | | Create a BitField instance
Parameters: mask - the mask specifying which bits apply to thisBitField. Bits that are set in this mask are thebits that this BitField operates on |
clear | public int clear(int holder)(Code) | | Clear the bits.
Parameters: holder - the int data containing the bits we're interestedin the value of holder with the specified bits cleared(set to 0) |
clearByte | public byte clearByte(byte holder)(Code) | | Clear the bits.
Parameters: holder - the byte data containing the bits we'reinterested in the value of holder with the specified bits cleared(set to 0) |
clearShort | public short clearShort(short holder)(Code) | | Clear the bits.
Parameters: holder - the short data containing the bits we'reinterested in the value of holder with the specified bits cleared(set to 0) |
getRawValue | public int getRawValue(int holder)(Code) | | Obtain the value for the specified BitField, unshifted
Parameters: holder - the int data containing the bits we're interestedin the selected bits |
getShortRawValue | public short getShortRawValue(short holder)(Code) | | Obtain the value for the specified BitField, unshifted
Parameters: holder - the short data containing the bits we'reinterested in the selected bits |
getShortValue | public short getShortValue(short holder)(Code) | | Obtain the value for the specified BitField, appropriately
shifted right, as a short. Many users of a BitField will want
to treat the specified bits as an int value, and will not want
to be aware that the value is stored as a BitField (and so
shifted left so many bits)
Parameters: holder - the short data containing the bits we'reinterested in the selected bits, shifted right appropriately |
getValue | public int getValue(int holder)(Code) | | Obtain the value for the specified BitField, appropriately
shifted right. Many users of a BitField will want to treat the
specified bits as an int value, and will not want to be aware
that the value is stored as a BitField (and so shifted left so
many bits)
Parameters: holder - the int data containing the bits we're interestedin the selected bits, shifted right appropriately |
isAllSet | public boolean isAllSet(int holder)(Code) | | 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
Parameters: holder - the int data containing the bits we're interestedin true if all of the bits are set, else false |
isSet | public boolean isSet(int holder)(Code) | | 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
Parameters: holder - the int data containing the bits we're interestedin true if any of the bits are set, else false |
set | public int set(int holder)(Code) | | Set the bits.
Parameters: holder - the int data containing the bits we're interestedin the value of holder with the specified bits set to 1 |
setBoolean | public int setBoolean(int holder, boolean flag)(Code) | | Set a boolean BitField
Parameters: holder - the int data containing the bits we're interestedin Parameters: flag - indicating whether to set or clear the bits the value of holder with the specified bits set orcleared |
setByte | public byte setByte(byte holder)(Code) | | Set the bits.
Parameters: holder - the byte data containing the bits we'reinterested in the value of holder with the specified bits set to 1 |
setByteBoolean | public byte setByteBoolean(byte holder, boolean flag)(Code) | | Set a boolean BitField
Parameters: holder - the byte data containing the bits we'reinterested in Parameters: flag - indicating whether to set or clear the bits the value of holder with the specified bits set orcleared |
setShort | public short setShort(short holder)(Code) | | Set the bits.
Parameters: holder - the short data containing the bits we'reinterested in the value of holder with the specified bits set to 1 |
setShortBoolean | public short setShortBoolean(short holder, boolean flag)(Code) | | Set a boolean BitField
Parameters: holder - the short data containing the bits we'reinterested in Parameters: flag - indicating whether to set or clear the bits the value of holder with the specified bits set orcleared |
setShortValue | public short setShortValue(short holder, short value)(Code) | | Replace the bits with new values.
Parameters: holder - the short data containing the bits we'reinterested in Parameters: value - the new value for the specified bits the value of holder with the bits from the valueparameter replacing the old bits |
setValue | public int setValue(int holder, int value)(Code) | | Replace the bits with new values.
Parameters: holder - the int data containint the bits we're interestedin Parameters: value - the new value for the specified bits the value of holder with the bits from the valueparameter replacing the old bits |
|
|