javar.methods
Class Command

java.lang.Object
  |
  +--javar.methods.Command
All Implemented Interfaces:
Code

public class Command
extends Object
implements Code

This class represents a single command and all the operations that are associated with this command.

Author:
Ben Litchfield

Nested Class Summary
 
Nested classes inherited from class javar.code.Code
Code.CodeHelper
 
Field Summary
 
Fields inherited from interface javar.code.Code
AALOAD, AASTORE, ACONST_NULL, ALOAD, ALOAD_0, ALOAD_1, ALOAD_2, ALOAD_3, ANEWARRAY, ARETURN, ARRAYLENGTH, ASTORE, ASTORE_0, ASTORE_1, ASTORE_2, ASTORE_3, ATHROW, BALOAD, BASTORE, BIPUSH, CASTORE, CHECKCAST, CODE_NAMES, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DLOAD_0, DLOAD_1, DLOAD_2, DLOAD_3, DMUL, DNEG, DREM, DRETURN, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FLOAD_0, FLOAD_1, FLOAD_2, FLOAD_3, FMUL, FNEG, FREM, FRETURN, FSUB, GETFIELD, GETSTATIC, GOTO, GOTO_W, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IINC, ILOAD, ILOAD_0, ILOAD_1, ILOAD_2, ILOAD_3, IMUL, INEG, INSTANCEOF, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISTORE_0, ISTORE_1, ISTORE_2, ISTORE_3, ISUB, IUSHR, IXOR, JSR, JSR_W, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDC_2W, LDC_W, LDIV, LLOAD, LLOAD_0, LLOAD_1, LLOAD_2, LLOAD_3, LMUL, LNEG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, NEW, NEWARRAY, NOP, POP, POP2, PUTFIELD, PUTSTATIC, RET, RETURN, SASTORE, SIPUSH, SWAP, TABLESWITCH, WIDE
 
Constructor Summary
Command(byte code)
          Constructor
 
Method Summary
 void addArgument(Object arg)
          This will add an argument that this command takes.
 Object getArgument(int i)
          This will get a specific argument
 List getArguments()
          This will get a specific argument
 byte[] getBytes()
          This will get the bytes of this command.
 int getIndex()
          This will get the index of where this code is located
 byte getOpCode()
          This will get the opcode for this command
 boolean isWide()
          This will tell if this is a wide or short command.
 void setIndex(int i)
          This will represent the index in code that this command is located
 void setWide(boolean w)
          This will set whether or not this is a wide command or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Command

public Command(byte code)
Constructor

Method Detail

isWide

public boolean isWide()
This will tell if this is a wide or short command.

Returns:
true if this command is a wide one

setWide

public void setWide(boolean w)
This will set whether or not this is a wide command or not

Parameters:
w - A boolean telling if this is a wide command or not

addArgument

public void addArgument(Object arg)
This will add an argument that this command takes.

Parameters:
arg - An argument for this command

getArgument

public Object getArgument(int i)
This will get a specific argument


getArguments

public List getArguments()
This will get a specific argument


setIndex

public void setIndex(int i)
This will represent the index in code that this command is located


getIndex

public int getIndex()
This will get the index of where this code is located


getOpCode

public byte getOpCode()
This will get the opcode for this command


getBytes

public byte[] getBytes()
                throws JavarIOException
This will get the bytes of this command.

Returns:
the command bytes
JavarIOException