TechTrader Bytecode Toolkit

com.techtrader.modules.tools.bytecode
Class IIncInstruction

java.lang.Object
  |
  +--com.techtrader.modules.tools.bytecode.Instruction
        |
        +--com.techtrader.modules.tools.bytecode.LocalVariableInstruction
              |
              +--com.techtrader.modules.tools.bytecode.IIncInstruction
Direct Known Subclasses:
WideInstruction

public class IIncInstruction
extends LocalVariableInstruction

Represents the IINC instruction.

Author:
Abe White

Fields inherited from class com.techtrader.modules.tools.bytecode.LocalVariableInstruction
_index
 
Fields inherited from class com.techtrader.modules.tools.bytecode.Instruction
_byteIndex, _opcode, _opcodeTypes, _owner
 
Constructor Summary
protected IIncInstruction(Code owner)
           
 
Method Summary
 void acceptVisit(BCVisitor visit)
          Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this object.
protected  void copy(Instruction other)
           
 boolean equals(Object other)
          Two local variable instructions are equal if the local index they reference is equal or if either index is 0/unset.
 int getIncrement()
          Return the increment for this IINC instruction.
 int getLength()
          Return the length in bytes of this opcode, including all arguments.
protected  void readData(DataInput in)
          Read the arguments for this opcode from the given stream.
 IIncInstruction setIncrement(int val)
          Set the increment on this IINC instruction.
protected  void writeData(DataOutput out)
          Write the arguments for this opcode to the given stream.
 
Methods inherited from class com.techtrader.modules.tools.bytecode.LocalVariableInstruction
calculateOpCode, getIndex, setIndex
 
Methods inherited from class com.techtrader.modules.tools.bytecode.Instruction
getByteIndex, getName, getOpCode, getOwner, getStackChange, invalidate, setByteIndex, setOpCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IIncInstruction

protected IIncInstruction(Code owner)
Method Detail

setIncrement

public IIncInstruction setIncrement(int val)
Set the increment on this IINC instruction.
Returns:
this Instruction, for method chaining

getIncrement

public int getIncrement()
Return the increment for this IINC instruction.

equals

public boolean equals(Object other)
Description copied from class: LocalVariableInstruction
Two local variable instructions are equal if the local index they reference is equal or if either index is 0/unset.
Overrides:
equals in class LocalVariableInstruction

getLength

public int getLength()
Description copied from class: Instruction
Return the length in bytes of this opcode, including all arguments. This method should be overridden by opcodes that take arguments.
Overrides:
getLength in class Instruction

copy

protected void copy(Instruction other)
Overrides:
copy in class LocalVariableInstruction

readData

protected void readData(DataInput in)
                 throws IOException
Description copied from class: Instruction
Read the arguments for this opcode from the given stream. This method should be overridden by opcodes that take arguments.
Overrides:
readData in class Instruction

writeData

protected void writeData(DataOutput out)
                  throws IOException
Description copied from class: Instruction
Write the arguments for this opcode to the given stream. This method should be overridden by opcodes that take arguments.
Overrides:
writeData in class Instruction

acceptVisit

public void acceptVisit(BCVisitor visit)
Description copied from interface: VisitAcceptor
Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this object.
Overrides:
acceptVisit in class Instruction

TechTrader Bytecode Toolkit