Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.chaoswg.xtc4y.classdesc.code.instructions
Class Instruction  view Instruction download Instruction.java

java.lang.Object
  extended bycom.chaoswg.xtc4y.classdesc.code.instructions.Instruction
Direct Known Subclasses:
BinaryInstruction, InvokeInterface, LookupSwitchInstruction, MultiANewArray, TableSwitchInstruction, TrinaryInstruction, UnaryInstruction, WideBinaryInstruction

public abstract class Instruction
extends java.lang.Object

An instruction is a operation executed in java and consists either of no operand or one operand. The size of the operand my vary between a byte and a short. These specific instructions are implemented in the subclasses


Field Summary
private  byte command
           
private  short index
           
 
Constructor Summary
protected Instruction(byte command)
          Creates a Instruction for a specific command
 
Method Summary
 byte getCommand()
           
 short getIndex()
           
abstract  int getNumberOfUsedBytes()
           
 byte getOpcode()
           
 void resolveIndices(com.chaoswg.xtc4y.classdesc.code.Code code)
          Resolve indices of instructions.
 void setIndex(short index)
          Set the index of this instruction, is set by the code container
 java.lang.String toString()
          Write code in a readable way
 void write(java.io.DataOutputStream dos, com.chaoswg.xtc4y.classdesc.ConstantPool cp)
          Write the instruction onto the DataOutputStream, using the constant pool to register variables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

command

private byte command

index

private short index
Constructor Detail

Instruction

protected Instruction(byte command)
Creates a Instruction for a specific command

Method Detail

write

public void write(java.io.DataOutputStream dos,
                  com.chaoswg.xtc4y.classdesc.ConstantPool cp)
           throws java.io.IOException
Write the instruction onto the DataOutputStream, using the constant pool to register variables. .


resolveIndices

public void resolveIndices(com.chaoswg.xtc4y.classdesc.code.Code code)
Resolve indices of instructions. By default do nothing


getNumberOfUsedBytes

public abstract int getNumberOfUsedBytes()

setIndex

public void setIndex(short index)
Set the index of this instruction, is set by the code container


getIndex

public short getIndex()

toString

public java.lang.String toString()
Write code in a readable way


getOpcode

public byte getOpcode()

getCommand

public byte getCommand()