org.apache.bcel.generic

Class IINC

Implemented Interfaces:
Cloneable, IndexedInstruction, Serializable, TypedInstruction

public class IINC
extends LocalVariableInstruction

IINC - Increment local variable by constant

Version:
$Id: IINC.java,v 1.2 2002/03/12 09:24:01 mdahm Exp $

Author:
M. Dahm

Nested Class Summary

Field Summary

Fields inherited from class org.apache.bcel.generic.LocalVariableInstruction

n

Fields inherited from class org.apache.bcel.generic.Instruction

length, opcode

Constructor Summary

IINC(int n, int c)

Method Summary

void
accept(Visitor v)
Call corresponding visitor method(s).
void
dump(DataOutputStream out)
Dump instruction as byte code to stream out.
int
getIncrement()
Type
getType(ConstantPoolGen cp)
protected void
initFromFile(ByteSequence bytes, boolean wide)
Read needed data (e.g.
void
setIncrement(int c)
Set increment factor.
void
setIndex(int n)
Set index of local variable.
String
toString(boolean verbose)

Methods inherited from class org.apache.bcel.generic.LocalVariableInstruction

dump, getCanonicalTag, getIndex, getType, initFromFile, setIndex, toString

Methods inherited from class org.apache.bcel.generic.Instruction

accept, consumeStack, copy, dump, equals, getComparator, getLength, getName, getOpcode, initFromFile, produceStack, readInstruction, setComparator, toString, toString, toString

Constructor Details

IINC

public IINC(int n,
            int c)

Parameters:
n - index of local variable
c - increment factor

Method Details

accept

public void accept(Visitor v)
Call corresponding visitor method(s). The order is: Call visitor methods of implemented interfaces first, then call methods according to the class hierarchy in descending order, i.e., the most specific visitXXX() call comes last.
Overrides:
accept in interface Instruction

Parameters:
v - Visitor object


dump

public void dump(DataOutputStream out)
            throws IOException
Dump instruction as byte code to stream out.
Overrides:
dump in interface LocalVariableInstruction

Parameters:
out - Output stream


getIncrement

public final int getIncrement()

Returns:
increment factor


getType

public Type getType(ConstantPoolGen cp)
Specified by:
getType in interface TypedInstruction
Overrides:
getType in interface LocalVariableInstruction

Returns:
int type


initFromFile

protected void initFromFile(ByteSequence bytes,
                            boolean wide)
            throws IOException
Read needed data (e.g. index) from file.
Overrides:
initFromFile in interface LocalVariableInstruction


setIncrement

public final void setIncrement(int c)
Set increment factor.


setIndex

public final void setIndex(int n)
Set index of local variable.
Specified by:
setIndex in interface IndexedInstruction
Overrides:
setIndex in interface LocalVariableInstruction


toString

public String toString(boolean verbose)
Overrides:
toString in interface LocalVariableInstruction

Returns:
mnemonic for instruction