Methods Summary |
---|
public int | clear(int holder)Clear the bits.
return holder & ~_mask;
|
public byte | clearByte(byte holder)Clear the bits.
return ( byte ) clear(holder);
|
public short | clearShort(short holder)Clear the bits.
return ( short ) clear(holder);
|
public int | getRawValue(int holder)Obtain the value for the specified BitField, unshifted
return (holder & _mask);
|
public short | getShortRawValue(short holder)Obtain the value for the specified BitField, unshifted
return ( short ) getRawValue(holder);
|
public short | getShortValue(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)
return ( short ) getValue(holder);
|
public int | getValue(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)
return getRawValue(holder) >> _shift_count;
|
public 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
return (holder & _mask) == _mask;
|
public 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
return (holder & _mask) != 0;
|
public int | set(int holder)Set the bits.
return holder | _mask;
|
public int | setBoolean(int holder, boolean flag)Set a boolean BitField
return flag ? set(holder)
: clear(holder);
|
public byte | setByte(byte holder)Set the bits.
return ( byte ) set(holder);
|
public byte | setByteBoolean(byte holder, boolean flag)Set a boolean BitField
return flag ? setByte(holder)
: clearByte(holder);
|
public short | setShort(short holder)Set the bits.
return ( short ) set(holder);
|
public short | setShortBoolean(short holder, boolean flag)Set a boolean BitField
return flag ? setShort(holder)
: clearShort(holder);
|
public short | setShortValue(short holder, short value)Replace the bits with new values.
return ( short ) setValue(holder, value);
|
public int | setValue(int holder, int value)Replace the bits with new values.
return (holder & ~_mask) | ((value << _shift_count) & _mask);
|