|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.eou.decimal.BitString
This class represents a field of binary bits, and
provides some fundamental operations on them. Instances
are delivered as the result of decimal encoding methods
on DecimalEncoder
, and may be
supplied as parameters to decimal decoding methods
on DecimalDecoder
.
Field Summary | |
(package private) byte[] |
fBits
|
(package private) int |
fNumberOfBits
|
Constructor Summary | |
BitString(int numberOfBits)
Create a new field of bits, with all bits initially reset and untouched. |
Method Summary | |
static BitString |
createFromBinary(java.lang.String bitpattern)
Create a new field of bits using the bit values stored in a string as 1s or 0s. |
static BitString |
createFromHexadecimal(java.lang.String hexpattern)
Create a new field of bits using the nybble values stored in a string as hexadecimal digits. |
boolean |
equals(java.lang.Object obj)
Return true if the supplied argument is a bit string equal to this bit string, ie having the same number of bits and all matching bit settings. |
void |
fillBits(int startbit,
boolean value)
Fill a range of bits, from the start bit to the end of the bit field, with the specified value. |
void |
fillBits(int startbit,
int bits,
boolean value)
Fill a range of bits with the specified value. |
boolean |
getBit(int bit)
Extract a bit. |
int |
getBits(int startbit,
int bits)
Extract a range of bits (up to 32 of them). |
int |
getNumberOfBits()
Return the number of bits in the field. |
void |
resetBit(int bit)
Reset the specified bit. |
void |
setBit(int bit)
Set the specified bit. |
void |
storeBit(int bit,
boolean value)
Store a bit. |
void |
storeBits(int startbit,
int bits,
int values)
Store a range of bits (up to 32 of them). |
java.lang.String |
toBitString()
Render the bit field as a string of 1s and 0s. |
java.lang.String |
toHexString()
Render the bit field as a string of hexadecimal digits, each representing four bits (one nybble) from the field. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
final int fNumberOfBits
final byte[] fBits
Constructor Detail |
public BitString(int numberOfBits)
Method Detail |
public static BitString createFromBinary(java.lang.String bitpattern)
public static BitString createFromHexadecimal(java.lang.String hexpattern)
public int getNumberOfBits()
public void resetBit(int bit)
public void setBit(int bit)
public void storeBit(int bit, boolean value)
public void storeBits(int startbit, int bits, int values)
public void fillBits(int startbit, int bits, boolean value)
public void fillBits(int startbit, boolean value)
public boolean getBit(int bit)
public int getBits(int startbit, int bits)
public java.lang.String toBitString()
public java.lang.String toHexString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |