Manage operations dealing with bit-mapped fields.
| Method from org.apache.cocoon.poi.util.BitField Detail: |
public int clear(int holder) {
return holder & ~_mask;
}
|
public byte clearByte(byte holder) {
return ( byte ) clear(holder);
}
|
public short clearShort(short holder) {
return ( short ) clear(holder);
}
|
public int getRawValue(int holder) {
return (holder & _mask);
}
Obtain the value for the specified BitField, unshifted |
public short getShortRawValue(short holder) {
return ( short ) getRawValue(holder);
}
Obtain the value for the specified BitField, unshifted |
public short getShortValue(short holder) {
return ( short ) getValue(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) |
public int getValue(int holder) {
return getRawValue(holder) > > _shift_count;
}
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) |
public boolean isAllSet(int holder) {
return (holder & _mask) == _mask;
}
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 |
public boolean isSet(int holder) {
return (holder & _mask) != 0;
}
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 |
public int set(int holder) {
return holder | _mask;
}
|
public int setBoolean(int holder,
boolean flag) {
return flag ? set(holder)
: clear(holder);
}
|
public byte setByte(byte holder) {
return ( byte ) set(holder);
}
|
public byte setByteBoolean(byte holder,
boolean flag) {
return flag ? setByte(holder)
: clearByte(holder);
}
|
public short setShort(short holder) {
return ( short ) set(holder);
}
|
public short setShortBoolean(short holder,
boolean flag) {
return flag ? setShort(holder)
: clearShort(holder);
}
|
public short setShortValue(short holder,
short value) {
return ( short ) setValue(holder, value);
}
Replace the bits with new values. |
public int setValue(int holder,
int value) {
return (holder & ~_mask) | ((value < < _shift_count) & _mask);
}
Replace the bits with new values. |