com.cmpware.fastmodel
Class Instruction

java.lang.Object
  extended by com.cmpware.fastmodel.Instruction

public class Instruction
extends java.lang.Object

This class defines an instruction used in the FastModel. It is intended to be extended and its methods over-ridden. Typically this class is extended once for each unique instruction 'type'.

Copyright (c) 2006 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Field Summary
protected  long addr
          The address of this instruction instance
protected  int code
          The instruction code
static java.lang.String copyright
          Copyright string
protected  Decoder decoder
          The instruction decoder
protected  Function function
          The instruction Function
protected  java.lang.String name
          The instruction name
 Instruction next
          The next cached instruction
protected  long profile
          The profile count
 
Constructor Summary
Instruction(java.lang.String name, Decoder decoder, Function function)
          This constructor initializes an instruction.
Instruction(java.lang.String name, Decoder decoder, Function function, int code)
          This constructor initializes an instruction.
 
Method Summary
static Instruction newInstance(Instruction i, FastModel fastModel)
          This static method returns a copy of an Instruction, with a new Function object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values

next

public Instruction next
The next cached instruction


addr

protected long addr
The address of this instruction instance


profile

protected long profile
The profile count


code

protected int code
The instruction code


name

protected java.lang.String name
The instruction name


decoder

protected Decoder decoder
The instruction decoder


function

protected Function function
The instruction Function

Constructor Detail

Instruction

public Instruction(java.lang.String name,
                   Decoder decoder,
                   Function function)
This constructor initializes an instruction.

Parameters:
name - the instruction name.
decoder - the instruction decoder.
function - the instruction functionality.

Instruction

public Instruction(java.lang.String name,
                   Decoder decoder,
                   Function function,
                   int code)
This constructor initializes an instruction.

Parameters:
name - the instruction name.
decoder - the instruction decoder.
function - the instruction functionality.
code - the instruction ID code.
Method Detail

newInstance

public static Instruction newInstance(Instruction i,
                                      FastModel fastModel)
This static method returns a copy of an Instruction, with a new Function object. This is used in the FastModel caching.

Parameters:
i - The instruction to be copied.
fastModel - The FastModel processor class for this instruction.
Returns:
a new Instruction object with a new Function object is returned. If an error occurs, a null is returned.