autohit.vm
Class VMExecutableWrapper

java.lang.Object
  extended byautohit.vm.VMExecutableWrapper

public class VMExecutableWrapper
extends java.lang.Object

This is a wrapper for an executable. It provides helpers and stuff. You shouldn't log from these helps. Also, most exceptions should be propogated, rather than handled, unless it's part of the normal logic.

Version:
1.0 Version History EPG - Initial - 15apr03
Author:
Erich P. Gatejen

Field Summary
 VMExecutable exec
          This is a reference to the executable.
 
Constructor Summary
VMExecutableWrapper()
          Default Constructor.
 
Method Summary
 void clean()
          Clean the core helper
 void create()
          Create a fresh and new executable
 void emit(VMInstruction i)
          Emit an instruction helper
 void load(java.io.InputStream is)
          Load a VMExecutable from a stream.
 java.lang.String nextDump()
          This returns the next line of the dump.
 int nextIP()
          Next IP location, if instruction were to be added
 void save(java.io.OutputStream os)
          Save a VMExecutable from a stream.
 java.lang.String startDump()
          This starts a dump of the executable.
 java.lang.String toString()
          Creates a text dump of the executable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

exec

public VMExecutable exec
This is a reference to the executable.

See Also:
VMExecutable
Constructor Detail

VMExecutableWrapper

public VMExecutableWrapper()
Default Constructor. The wrappers are always empty. You need to load or create the executable.

See Also:
load(InputStream is), create()
Method Detail

emit

public void emit(VMInstruction i)
Emit an instruction helper

See Also:
VMInstruction

nextIP

public int nextIP()
Next IP location, if instruction were to be added

See Also:
VMInstruction

clean

public void clean()
Clean the core helper

See Also:
VMInstruction

create

public void create()
Create a fresh and new executable

See Also:
VMExecutable

load

public void load(java.io.InputStream is)
          throws java.lang.Exception
Load a VMExecutable from a stream. This will deserialize it.

Throws:
any - exception
java.lang.Exception
See Also:
VMExecutable

save

public void save(java.io.OutputStream os)
          throws java.lang.Exception
Save a VMExecutable from a stream. This will serialize it.

Throws:
any - exception
java.lang.Exception
See Also:
VMExecutable

startDump

public java.lang.String startDump()
This starts a dump of the executable. It will yield the first line. When there is no more to dump, it will return a null.

Returns:
a String containing the first line of the dump or null.

nextDump

public java.lang.String nextDump()
This returns the next line of the dump. It will return null if the dump is done or not valid.

Returns:
a String containing the next line of the dump or null.

toString

public java.lang.String toString()
Creates a text dump of the executable. It will use line.seperator system property as the line terminator.

Returns:
a String containing the text dump.


Test.