|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objecttapeutils.impl.SimpleBitProcessor
This class provides a processor for bit values.
This implementation collects the bits up into a byte (assume MSB first) and then calls the byte processor for each complete byte.
| Constructor Summary | |
|---|---|
SimpleBitProcessor(SampleAnalyzer analyzer,
ByteProcessor processor)
Construct the bit processor. |
|
| Method Summary | |
|---|---|
void |
addBit(int bitStart,
int bitEnd,
int bitValue)
Add the bit to the current byte. |
int |
getBitEndIndex(int number)
Get the index of the end of the given bit number. |
void |
getBitNumber(int index,
int[] pos)
Get the bit number at the given position in the sample. |
int |
getBitStartIndex(int number)
Get the index of the start of the given bit number. |
int |
getBitValue(int index)
Get the bit value at the given position in the sample. |
int |
getFirstBitStartIndex()
Get the index of the start of the first bit found in the sample. |
int |
getLastBitEndIndex()
Get the index of the end of the last bit extracted from the sample. |
int |
getLastBitValue()
Get the value of the last bit extracted. |
int |
getNumberOfBits()
Get the number of bits processed. |
void |
initialize()
Initialize this object ready for processing a sample. |
int |
undoLastBit()
Undo the last bit that was processed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimpleBitProcessor(SampleAnalyzer analyzer,
ByteProcessor processor)
analyzer - The sample analyzer.processor - The byte processor.| Method Detail |
public void initialize()
initialize in interface BitProcessor
public void addBit(int bitStart,
int bitEnd,
int bitValue)
addBit in interface BitProcessorbitStart - The start of the bit.bitEnd - The end of the bit.bitValue - The bit value.public int undoLastBit()
undoLastBit in interface BitProcessorpublic int getBitValue(int index)
getBitValue in interface BitProcessorindex - The index.
public void getBitNumber(int index,
int[] pos)
getBitNumber in interface BitProcessorindex - The index.pos - An array which will contain the bit number and offset from the start of the bit.public int getBitStartIndex(int number)
getBitStartIndex in interface BitProcessornumber - The bit number.
public int getBitEndIndex(int number)
getBitEndIndex in interface BitProcessornumber - The bit number.
public int getLastBitValue()
getLastBitValue in interface BitProcessorpublic int getFirstBitStartIndex()
getFirstBitStartIndex in interface BitProcessorpublic int getLastBitEndIndex()
getLastBitEndIndex in interface BitProcessorpublic int getNumberOfBits()
getNumberOfBits in interface BitProcessor
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||