jmce - 1_02

jmce.sim.cpu
Class AbstractDecoder

java.lang.Object
  extended by jmce.sim.cpu.AbstractDecoder
All Implemented Interfaces:
Decoder

public abstract class AbstractDecoder
extends java.lang.Object
implements Decoder

Sample imlementation of decoder.

Version:
1.00
Author:
Mario Viara

Field Summary
protected  int size
           
 
Constructor Summary
protected AbstractDecoder(java.lang.String pattern, int size)
           
 
Method Summary
 int decode(CPU cpu, CpuRuntime r, int startPc, int len, int currentPc, java.lang.StringBuffer line)
           
 java.lang.String getPattern()
          Return the managed pattern
protected abstract  java.lang.String implDecode(CPU cpu, CpuRuntime r, int startPc, int len, int currentPc)
          Subclass must return the correct string
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

size

protected int size
Constructor Detail

AbstractDecoder

protected AbstractDecoder(java.lang.String pattern,
                          int size)
Method Detail

decode

public int decode(CPU cpu,
                  CpuRuntime r,
                  int startPc,
                  int len,
                  int currentPc,
                  java.lang.StringBuffer line)
           throws SIMException
Specified by:
decode in interface Decoder
Throws:
SIMException

getPattern

public java.lang.String getPattern()
Description copied from interface: Decoder
Return the managed pattern

Specified by:
getPattern in interface Decoder

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

implDecode

protected abstract java.lang.String implDecode(CPU cpu,
                                               CpuRuntime r,
                                               int startPc,
                                               int len,
                                               int currentPc)
                                        throws SIMException
Subclass must return the correct string

Throws:
SIMException

jmce - 1_02