tapeutils.impl.zx81
Class ZX81BASICByteProcessor

java.lang.Object
  extended bytapeutils.impl.SimpleByteProcessor
      extended bytapeutils.impl.zx81.ZX81BASICByteProcessor
All Implemented Interfaces:
ByteProcessor

public class ZX81BASICByteProcessor
extends SimpleByteProcessor

This class provides a processor of extracted bytes that is specific to a ZX81 BASIC program.

It expects the bytes to start with the program name, terminated by a character with the high bit set. This is then followed by a dump of memory from thesystem variables to the end of the program.

Author:
hldswrth

Field Summary
 
Fields inherited from class tapeutils.impl.SimpleByteProcessor
mByteEndMap, mBytes, mNumExpectedBytes, mSampleAnalyzer
 
Constructor Summary
ZX81BASICByteProcessor(ZX81SampleAnalyzer analyzer)
          Construct the byte processor.
 
Method Summary
 java.lang.String checkConsistent()
          Checks whether the loaded bytes are consistent.
 byte[] getBytes()
          Get the program bytes.
 void initialize()
          Initialize this object ready for processing a sample.
 int numBytesProcessed()
          Returns the number of bytes processed.
 void processByte(int start, int end, int byteValue)
          Process the current byte.
 int undoLastByte()
          Undo the last byte that was extracted..
 
Methods inherited from class tapeutils.impl.SimpleByteProcessor
getByteIndex, getByteNumber, getByteNumber, getByteValue, numExpectedBytes, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZX81BASICByteProcessor

public ZX81BASICByteProcessor(ZX81SampleAnalyzer analyzer)
Construct the byte processor.

Parameters:
analyzer - The sample analyzer.
Method Detail

initialize

public void initialize()
Initialize this object ready for processing a sample.

Specified by:
initialize in interface ByteProcessor
Overrides:
initialize in class SimpleByteProcessor

processByte

public void processByte(int start,
                        int end,
                        int byteValue)
Process the current byte.

Specified by:
processByte in interface ByteProcessor
Overrides:
processByte in class SimpleByteProcessor
Parameters:
start - The offset of the byte.
end - The end offset of the byte.
byteValue - The byte value.

undoLastByte

public int undoLastByte()
Undo the last byte that was extracted..

Specified by:
undoLastByte in interface ByteProcessor
Overrides:
undoLastByte in class SimpleByteProcessor
Returns:
The value of the last byte.

getBytes

public byte[] getBytes()
Get the program bytes.

Specified by:
getBytes in interface ByteProcessor
Overrides:
getBytes in class SimpleByteProcessor
Returns:
The byte values.

numBytesProcessed

public int numBytesProcessed()
Returns the number of bytes processed.

Returns 0, unless the number of bytes read is greater than that required for system variables.

Specified by:
numBytesProcessed in interface ByteProcessor
Overrides:
numBytesProcessed in class SimpleByteProcessor
Returns:
The number of bytes processed.

checkConsistent

public java.lang.String checkConsistent()
Checks whether the loaded bytes are consistent.

Specified by:
checkConsistent in interface ByteProcessor
Overrides:
checkConsistent in class SimpleByteProcessor
Returns:
null if consistent, otherwise error message.