com.partnersoft.maps.rover
Interface RoverCodec

All Known Implementing Classes:
RoverCodecV448

public interface RoverCodec

A coder/decoder implementation for a specific rover bytecode format.

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Method Summary
 void execute(DynamicByteArray bytecode, RoverMachineRegister register, RoverMachineActor actor)
          Execute the given bytecode with a RoverMachine, storing data in the given register and sending events to the given actor.
 RoverBlock readBlock(DynamicByteArray bytes)
          Read a block from the given byte array.
 void writeBlock(RoverBlock block, DynamicByteArray bytes)
          Write a block to the given byte array.
 

Method Detail

readBlock

RoverBlock readBlock(DynamicByteArray bytes)
                     throws RoverFormatException
Read a block from the given byte array.

Parameters:
bytes - encoded rover bytes
Returns:
block read
Throws:
RoverFormatException

writeBlock

void writeBlock(RoverBlock block,
                DynamicByteArray bytes)
                throws RoverFormatException
Write a block to the given byte array.

Parameters:
bytes - encoded rover bytes
Throws:
RoverFormatException

execute

void execute(DynamicByteArray bytecode,
             RoverMachineRegister register,
             RoverMachineActor actor)
             throws java.io.IOException
Execute the given bytecode with a RoverMachine, storing data in the given register and sending events to the given actor.

This method should be as fast as possible. Avoid allocations, external calls, or anything else that will compromise performance. Comment out log statements rather than testing for log.isDebugEnabled(). Etc.

Throws:
java.io.IOException