A collection of simple utilities for manipulating bitfields.
More...
Static Public Member Functions |
| static int | getBitField (int value, int offset, int len) |
| | Return the numeric value of a subset of bits.
|
| static long | getBitField (long value, int offset, int len) |
| | Return the numeric value of a subset of bits.
|
| static int | setBitField (int value, int offset, int len, int newVal) |
| | Set the numeric value of a subset of bits.
|
| static long | setBitField (long value, int offset, int len, long newVal) |
| | Set the numeric value of a subset of bits.
|
Detailed Description
A collection of simple utilities for manipulating bitfields.
Member Function Documentation
| static int com.mak.vrlj.vl.BitUtil.getBitField |
( |
int |
value, |
|
|
int |
offset, |
|
|
int |
len |
|
) |
| |
|
inlinestatic |
Return the numeric value of a subset of bits.
- Parameters
-
| value | the original value containing the bitfield. |
| offset | the offset of the least valued bit (e.g. 0 = bitfield starts with bit 0). |
| len | the number of bits to use. |
- Returns
- the value of the bitfield.
Referenced by com.mak.vrlj.object.Entity.getAppearanceBitField().
| static long com.mak.vrlj.vl.BitUtil.getBitField |
( |
long |
value, |
|
|
int |
offset, |
|
|
int |
len |
|
) |
| |
|
inlinestatic |
Return the numeric value of a subset of bits.
- Parameters
-
| value | the original value containing the bitfield. |
| offset | the offset of the least valued bit (e.g. 0 = bitfield starts with bit 0). |
| len | the number of bits to use. |
- Returns
- the value of the bitfield.
| static int com.mak.vrlj.vl.BitUtil.setBitField |
( |
int |
value, |
|
|
int |
offset, |
|
|
int |
len, |
|
|
int |
newVal |
|
) |
| |
|
inlinestatic |
Set the numeric value of a subset of bits.
- Parameters
-
| value | the original value containing the bitfield. |
| offset | the offset of the least valued bit (e.g. 0 = bitfield starts with bit 0). |
| len | the number of bits to use. |
| newVal | the new value for the bitfield. |
- Returns
- the original value with the bitfield bits overwritten with the new value newVal.
Referenced by com.mak.vrlj.object.Entity.setAppearanceBitField().
| static long com.mak.vrlj.vl.BitUtil.setBitField |
( |
long |
value, |
|
|
int |
offset, |
|
|
int |
len, |
|
|
long |
newVal |
|
) |
| |
|
inlinestatic |
Set the numeric value of a subset of bits.
- Parameters
-
| value | the original value containing the bitfield. |
| offset | the offset of the least valued bit (e.g. 0 = bitfield starts with bit 0). |
| len | the number of bits to use. |
| newVal | the new value for the bitfield. |
- Returns
- the original value with the bitfield bits overwritten with the new value newVal.
The documentation for this class was generated from the following file: