| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | BitField(final int
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)Create a BitField instance |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the value of holder with the specified bits cleared (set to 0)the int data containing the bits we're interested in holder)Clear the bits. |
| public byte | Returns: the value of holder with the specified bits cleared (set to 0)the byte data containing the bits we're
interested in holder)Clear the bits. |
| public short | Returns: the value of holder with the specified bits cleared (set to 0)the short data containing the bits we're
interested in holder)Clear the bits. |
| public int | |
| public int | Returns: the selected bitsthe int data containing the bits we're interested
in holder)Obtain the value for the specified BitField, unshifted |
| public short | Returns: the selected bitsthe short data containing the bits we're
interested in holder)Obtain the value for the specified BitField, unshifted |
| public short | Returns: the selected bits, shifted right appropriatelythe short data containing the bits we're
interested in holder)Obtain the value for the specified BitField, appropriately shifted right, as a short. |
| public int | Returns: the selected bits, shifted right appropriatelythe int data containing the bits we're interested
in holder)Obtain the value for the specified BitField, appropriately shifted right. |
| public boolean | Returns: true if all of the bits are set, else falsethe int data containing the bits we're interested in holder)Are all of the bits set or not? |
| public boolean | Returns: true if any of the bits are set, else falsethe int data containing the bits we're interested in holder)Is the field set or not? |
| public int | Returns: the value of holder with the specified bits set to 1the int data containing the bits we're interested
in holder)Set the bits. |
| public int | Returns: the value of holder with the specified bits set or clearedthe int data containing the bits we're interested
in holder, final boolean indicating whether to set or clear the bits flag)Set a boolean BitField |
| public byte | Returns: the value of holder with the specified bits set to 1the byte data containing the bits we're
interested in holder)Set the bits. |
| public byte | Returns: the value of holder with the specified bits set or clearedthe byte data containing the bits we're
interested in holder, final boolean indicating whether to set or clear the bits flag)Set a boolean BitField |
| public short | Returns: the value of holder with the specified bits set to 1the short data containing the bits we're
interested in holder)Set the bits. |
| public short | Returns: the value of holder with the specified bits set or clearedthe short data containing the bits we're
interested in holder, final boolean indicating whether to set or clear the bits flag)Set a boolean BitField |
| public short | Returns: the value of holder with the bits from the value parameter replacing the old bitsthe short data containing the bits we're interested in holder, final short the new value for the specified bits value)Replace the bits with new values. |
| public int | Returns: the value of holder with the bits from the value parameter replacing the old bitsthe int data containing the bits we're interested in holder, final int the new value for the specified bits value)Replace the bits with new values. |
| _mask | back to summary |
|---|---|
| private final int _mask | |
| _shift_count | back to summary |
|---|---|
| private final int _shift_count | |
| BitField | back to summary |
|---|---|
| public BitField(final int mask) Create a BitField instance
| |
| clear | back to summary |
|---|---|
| public int clear(final int holder) Clear the bits.
| |
| clearByte | back to summary |
|---|---|
| public byte clearByte(final byte holder) Clear the bits.
| |
| clearShort | back to summary |
|---|---|
| public short clearShort(final short holder) Clear the bits.
| |
| getMask | back to summary |
|---|---|
| public int getMask() | |
| getRawValue | back to summary |
|---|---|
| public int getRawValue(final int holder) Obtain the value for the specified BitField, unshifted
| |
| getShortRawValue | back to summary |
|---|---|
| public short getShortRawValue(final short holder) Obtain the value for the specified BitField, unshifted
| |
| getShortValue | back to summary |
|---|---|
| public short getShortValue(final short holder) 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)
| |
| getValue | back to summary |
|---|---|
| public int getValue(final int holder) 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)
| |
| isAllSet | back to summary |
|---|---|
| public boolean isAllSet(final 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 | back to summary |
|---|---|
| public boolean isSet(final 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
| |
| set | back to summary |
|---|---|
| public int set(final int holder) Set the bits.
| |
| setBoolean | back to summary |
|---|---|
| public int setBoolean(final int holder, final boolean flag) Set a boolean BitField
| |
| setByte | back to summary |
|---|---|
| public byte setByte(final byte holder) Set the bits.
| |
| setByteBoolean | back to summary |
|---|---|
| public byte setByteBoolean(final byte holder, final boolean flag) Set a boolean BitField
| |
| setShort | back to summary |
|---|---|
| public short setShort(final short holder) Set the bits.
| |
| setShortBoolean | back to summary |
|---|---|
| public short setShortBoolean(final short holder, final boolean flag) Set a boolean BitField
| |
| setShortValue | back to summary |
|---|---|
| public short setShortValue(final short holder, final short value) Replace the bits with new values.
| |
| setValue | back to summary |
|---|---|
| public int setValue(final int holder, final int value) Replace the bits with new values.
| |