org.ow2.asmdex.instruction
Class PseudoInstructionSparseSwitch

java.lang.Object
  extended by org.ow2.asmdex.instruction.Instruction
      extended by org.ow2.asmdex.instruction.PseudoInstructionSparseSwitch
All Implemented Interfaces:
IPseudoInstruction

public class PseudoInstructionSparseSwitch
extends Instruction
implements IPseudoInstruction

A Sparse-Switch Pseudo-Instruction. It should use a 4-byte alignment but it is NOT managed here.

Author:
Julien Névo

Field Summary
 
Fields inherited from class org.ow2.asmdex.instruction.Instruction
lineNumber, opcodeByte, opcodeHighOrderByte
 
Constructor Summary
PseudoInstructionSparseSwitch(int[] keys, Label[] targets, IOffsetInstruction instructionSparseSwitch)
          Constructor of the Sparse Switch Pseudo Instruction.
 
Method Summary
 int getSize()
          Returns the size of the instruction in bytes.
 IOffsetInstruction getSourceInstruction()
          Returns the Instruction that requires the data of the current Instruction.
 void write(ByteVector out, ConstantPool constantPool)
          Encodes the instruction, in the Dalvik format, to an output buffer.
 
Methods inherited from class org.ow2.asmdex.instruction.Instruction
getInstructionSizeInByte, getLineNumber, getOpcodeByte, getOpcodeHighOrderByte, setLineNumber, test4BitsLimit, test4BitsLimit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PseudoInstructionSparseSwitch

public PseudoInstructionSparseSwitch(int[] keys,
                                     Label[] targets,
                                     IOffsetInstruction instructionSparseSwitch)
Constructor of the Sparse Switch Pseudo Instruction.

Parameters:
keys - the keys for each Case.
targets - the targets for each Case.
instructionSparseSwitch - reference to the Sparse Switch Instruction.
Method Detail

getSourceInstruction

public IOffsetInstruction getSourceInstruction()
Description copied from interface: IPseudoInstruction
Returns the Instruction that requires the data of the current Instruction.

Specified by:
getSourceInstruction in interface IPseudoInstruction
Returns:
the Instruction that requires the data of the current Instruction.

getSize

public int getSize()
Description copied from class: Instruction
Returns the size of the instruction in bytes.

Specified by:
getSize in class Instruction
Returns:
the size of the instruction in bytes.

write

public void write(ByteVector out,
                  ConstantPool constantPool)
Description copied from class: Instruction
Encodes the instruction, in the Dalvik format, to an output buffer.

Specified by:
write in class Instruction
Parameters:
out - output buffer.
constantPool - the constantPool.