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

java.lang.Object
  extended bycom.chaoswg.xtc4y.classdesc.code.instructions.Instruction
      extended bycom.chaoswg.xtc4y.classdesc.code.instructions.WideBinaryInstruction
Direct Known Subclasses:
CPRefInstruction, JumpInstruction, NewArray

public class WideBinaryInstruction
extends Instruction

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


Field Summary
static byte NEWARRAY
          create a new array
private  short operand
           
static byte SIPUSH
          push a short onto the stack
 
Fields inherited from class com.chaoswg.xtc4y.classdesc.code.instructions.Instruction
 
Constructor Summary
  WideBinaryInstruction(byte command)
          Create a new binary instruction with a command and the short value as operand
protected WideBinaryInstruction(byte command, java.io.DataInputStream dis, com.chaoswg.xtc4y.classdesc.ConstantPool cp)
          Creates an WideBinaryInstruction and initializes it from a DataInputStream
 
Method Summary
 int getNumberOfUsedBytes()
           
protected  short getOperand(com.chaoswg.xtc4y.classdesc.ConstantPool cp)
           
protected  void handleOperand(short operand, com.chaoswg.xtc4y.classdesc.ConstantPool cp)
          Handle operand.
 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 com.chaoswg.xtc4y.classdesc.code.instructions.Instruction
getCommand, getIndex, getOpcode, resolveIndices, setIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

operand

private short operand

SIPUSH

public static final byte SIPUSH
push a short onto the stack

See Also:
Constant Field Values

NEWARRAY

public static final byte NEWARRAY
create a new array

See Also:
Constant Field Values
Constructor Detail

WideBinaryInstruction

protected WideBinaryInstruction(byte command,
                                java.io.DataInputStream dis,
                                com.chaoswg.xtc4y.classdesc.ConstantPool cp)
                         throws java.io.IOException
Creates an WideBinaryInstruction and initializes it from a DataInputStream


WideBinaryInstruction

public WideBinaryInstruction(byte command)
Create a new binary instruction with a command and the short value as operand

Method Detail

handleOperand

protected void handleOperand(short operand,
                             com.chaoswg.xtc4y.classdesc.ConstantPool cp)
Handle operand. By default, the operands value is 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

getOperand

protected short getOperand(com.chaoswg.xtc4y.classdesc.ConstantPool cp)

getNumberOfUsedBytes

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

toString

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

Overrides:
toString in class Instruction