org.apache.bcel.generic

Class RET

Implemented Interfaces:
Cloneable, IndexedInstruction, Serializable, TypedInstruction

public class RET
extends Instruction
implements IndexedInstruction, TypedInstruction

RET - Return from subroutine
Stack: ... -> ...
Version:
$Id: RET.java 386056 2006-03-15 11:31:56Z tcurdt $
Author:
M. Dahm

Field Summary

private int
index
private boolean
wide

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

cmp, length, opcode

Constructor Summary

RET()
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction().
RET(int index)

Method Summary

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

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

index

private int index

wide

private boolean wide

Constructor Details

RET

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

RET

public RET(int index)

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 Instruction
Parameters:
out - Output stream

getIndex

public final int getIndex()
Specified by:
getIndex in interface IndexedInstruction
Returns:
index of local variable containg the return address

getType

public Type getType(ConstantPoolGen cp)
Specified by:
getType in interface TypedInstruction
Returns:
return address type

initFromFile

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

setIndex

public final void setIndex(int n)
Set index of local variable containg the return address
Specified by:
setIndex in interface IndexedInstruction

setWide

private final void setWide()

toString

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