jef.dna.instructions
Interface InstructionFactory

All Known Implementing Classes:
InstructionFactory

public interface InstructionFactory

This interface defines the set of methods every concrete class meant for instantiating bytecode instruction classes should define.

Author:
Francesco Russo (frusso@cs.unibo.it)

Method Summary
 Instruction getInstruction(byte opCode)
          This method returns class instances implementing the Instruction interface.
 Instruction getInstruction(int opCode)
          This method returns classe instances implementing the Instruction interface.
 int getIntOpCodeFromByte(byte opCode)
          Method for obtaining the int value associated with the given byte representation of the JVM's instruction operation code.
 byte getIntOpCodeFromByte(int opCode)
          Method for obtaining the byte value associated with the given int representation of the JVM's instruction operation code.
 

Method Detail

getInstruction

Instruction getInstruction(int opCode)
                           throws UnknownOpCodeException
This method returns classe instances implementing the Instruction interface. It requires as input parameter the numeric operation code which identifies the instruction we want to create.

Parameters:
opCode - The instruction opcode
Returns:
An Instruction class.
Throws:
UnknownOpCodeException - The specified opcode has not been recognized

getInstruction

Instruction getInstruction(byte opCode)
                           throws UnknownOpCodeException
This method returns class instances implementing the Instruction interface. It requires as input parameter the numeric operation code which identifies the instruction we want to create.

Parameters:
opCode - The opcode identifying the desired instruction
Returns:
Instruction An Instruction class.
Throws:
UnknownOpCodeException - The specified opCode is not recognized

getIntOpCodeFromByte

int getIntOpCodeFromByte(byte opCode)
Method for obtaining the int value associated with the given byte representation of the JVM's instruction operation code.

Parameters:
opCode - The operation code as a byte
Returns:
int The operation code as an integer value

getIntOpCodeFromByte

byte getIntOpCodeFromByte(int opCode)
Method for obtaining the byte value associated with the given int representation of the JVM's instruction operation code.

Parameters:
opCode - The operation code as an integter value
Returns:
byte The operation code a byte