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 TrinaryInstruction  view TrinaryInstruction download TrinaryInstruction.java

java.lang.Object
  extended bycom.chaoswg.xtc4y.classdesc.code.instructions.Instruction
      extended bycom.chaoswg.xtc4y.classdesc.code.instructions.TrinaryInstruction

public class TrinaryInstruction
extends Instruction

A binary instruction consists of a command and two one byte operands, therefore its size is 3 bytes


Field Summary
static byte IINC
          increment local indexed variable by the second operand
private  byte operand1
           
private  byte operand2
           
 
Fields inherited from class com.chaoswg.xtc4y.classdesc.code.instructions.Instruction
 
Constructor Summary
TrinaryInstruction(byte command, byte operand1, byte operand2)
          Create a new binary instruction with a command and the byte value as operand
TrinaryInstruction(byte command, java.io.DataInputStream dis, com.chaoswg.xtc4y.classdesc.ConstantPool cp)
          Creates an TrinaryInstruction and initializes it from a DataInputStream.
 
Method Summary
 int getNumberOfUsedBytes()
           
protected  byte getOperand1(com.chaoswg.xtc4y.classdesc.ConstantPool cp)
           
protected  byte getOperand2(com.chaoswg.xtc4y.classdesc.ConstantPool cp)
           
protected  void handleOperands(byte operand1, byte operand2, com.chaoswg.xtc4y.classdesc.ConstantPool cp)
          Handle operands.
 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 com.chaoswg.xtc4y.classdesc.code.instructions.Instruction
getCommand, getIndex, getOpcode, resolveIndices, setIndex, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

operand1

private byte operand1

operand2

private byte operand2

IINC

public static final byte IINC
increment local indexed variable by the second operand

See Also:
Constant Field Values
Constructor Detail

TrinaryInstruction

public TrinaryInstruction(byte command,
                          java.io.DataInputStream dis,
                          com.chaoswg.xtc4y.classdesc.ConstantPool cp)
                   throws java.io.IOException
Creates an TrinaryInstruction and initializes it from a DataInputStream. the operand is read from the stream and provided to extending classes for a further handling of it


TrinaryInstruction

public TrinaryInstruction(byte command,
                          byte operand1,
                          byte operand2)
Create a new binary instruction with a command and the byte value as operand

Method Detail

handleOperands

protected void handleOperands(byte operand1,
                              byte operand2,
                              com.chaoswg.xtc4y.classdesc.ConstantPool cp)
Handle operands. By default, the operands values are stored. Another behaviour may be implemented in an extending class


write

public final 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. .

Overrides:
write in class Instruction

getOperand1

protected byte getOperand1(com.chaoswg.xtc4y.classdesc.ConstantPool cp)

getOperand2

protected byte getOperand2(com.chaoswg.xtc4y.classdesc.ConstantPool cp)

getNumberOfUsedBytes

public final int getNumberOfUsedBytes()
Specified by:
getNumberOfUsedBytes in class Instruction