jef.dna.instructions.impl
Class InstructionAncestorRefsCpt

java.lang.Object
  extended by jef.dna.instructions.impl.InstructionAncestor
      extended by jef.dna.instructions.impl.InstructionAncestorRefsCpt
All Implemented Interfaces:
java.lang.Cloneable, Instruction, InstructionRefsCpt, BytesCountable
Direct Known Subclasses:
InstructionRefsCpt16, InstructionRefsCpt8

public abstract class InstructionAncestorRefsCpt
extends InstructionAncestor
implements InstructionRefsCpt

This class is the ancestor of all the concrete instruction classes referring the constant pool table.

Author:
ggiovanzana

Field Summary
protected static Logger logger
          Logger
protected static int MASK
          Bit mask used to extract a byte value from an int value.
protected static int SHIFT
          Positions to shift.
 
Fields inherited from class jef.dna.instructions.impl.InstructionAncestor
opCode, operands, operandsCount
 
Constructor Summary
InstructionAncestorRefsCpt()
           
 
Method Summary
 java.lang.Object clone()
          Clone this instance.
abstract  int getIndex()
          Provides the reference to the constant pool table.
abstract  void setIndex(int index)
          Sets the reference to the constant pool table.
 int updateRefs(int offset)
          This method implements the logic necessary to update all the references to constant pool table's entries contained within the bytecode instruction.
 
Methods inherited from class jef.dna.instructions.impl.InstructionAncestor
fromArray, getBytesCount, getOpCode, getOperands, getOperandsCount, setOpCode, setOperands, setOperandsCountPosticipated, toArray
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jef.dna.instructions.Instruction
fromArray, getOpCode, getOperands, getOperandsCount, setOpCode, setOperands, setOperandsCountPosticipated, toArray
 
Methods inherited from interface jef.dna.util.BytesCountable
getBytesCount
 

Field Detail

logger

protected static Logger logger
Logger


SHIFT

protected static final int SHIFT
Positions to shift.

See Also:
Constant Field Values

MASK

protected static final int MASK
Bit mask used to extract a byte value from an int value.

See Also:
Constant Field Values
Constructor Detail

InstructionAncestorRefsCpt

public InstructionAncestorRefsCpt()
Method Detail

getIndex

public abstract int getIndex()
Provides the reference to the constant pool table.

Specified by:
getIndex in interface InstructionRefsCpt
Returns:
int The index into the constant pool table

setIndex

public abstract void setIndex(int index)
Sets the reference to the constant pool table.

Specified by:
setIndex in interface InstructionRefsCpt
Parameters:
index - The index into the constant pool table

updateRefs

public int updateRefs(int offset)
This method implements the logic necessary to update all the references to constant pool table's entries contained within the bytecode instruction.

Specified by:
updateRefs in interface Instruction
Overrides:
updateRefs in class InstructionAncestor
Parameters:
offset - The offset used for updating expressed as number of cpt's entries to be skipped
Returns:
int The number of processed words within the current bytecode instruction

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone this instance.

Specified by:
clone in interface Instruction
Overrides:
clone in class InstructionAncestor
Returns:
The clone
Throws:
java.lang.CloneNotSupportedException