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 386056 2006-03-15 11:31:56Z tcurdt $
Author:
M. Dahm

Field Summary

private int
c
private boolean
wide

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

c_tag, canon_tag, n

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

cmp, length, opcode

Constructor Summary

IINC()
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction().
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.
private void
setWide()
String
toString(boolean verbose)

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

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

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

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

Field Details

c

private int c

wide

private boolean wide

Constructor Details

IINC

(package private)  IINC()
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction(). Not to be used otherwise.

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

setWide

private final void setWide()

toString

public String toString(boolean verbose)
Overrides:
toString in interface LocalVariableInstruction
Returns:
mnemonic for instruction