All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gnu.bytecode.Variable

java.lang.Object
   |
   +----gnu.bytecode.Location
           |
           +----gnu.bytecode.Variable

public class Variable
extends Location
implements Enumeration

Variable Index

 o offset
The local variable slot number used by this variable.

Constructor Index

 o Variable()

Method Index

 o allocateLocal(CodeAttr)
Allocate slots for a local variable (or parameter).
 o freeLocal(CodeAttr)
 o hasMoreElements()
 o isArtificial()
 o isAssigned()
Returns true iff assigned to a local variable slot.
 o isParameter()
 o isSimple()
Returns true for a "simple" variable.
 o nextElement()
 o nextVar()
 o reserveLocal(int, CodeAttr)
Assign a local variable to a given local variable slot.
 o setArtificial(boolean)
 o setParameter(boolean)
 o setSimple(boolean)

Variables

 o offset
 public int offset
The local variable slot number used by this variable. Not used (by the codegen layer) if !isSimple().

Constructors

 o Variable
 public Variable()

Methods

 o nextVar
 public final Variable nextVar()
 o hasMoreElements
 public final boolean hasMoreElements()
 o nextElement
 public Object nextElement()
 o isAssigned
 public final boolean isAssigned()
Returns true iff assigned to a local variable slot. Only relevant if isSimple ().

 o isSimple
 public final boolean isSimple()
Returns true for a "simple" variable. A "simple" Variable can be stack-allocated using standard local variable slots. It is allocated by the codegen package. A non-simple variable may need heap allocation, or more more complex access; it is basically ignored by the codegen package, and must be managed by higher layers.

 o setSimple
 public final void setSimple(boolean simple)
 o isParameter
 public final boolean isParameter()
 o setParameter
 public final void setParameter(boolean parameter)
 o isArtificial
 public final boolean isArtificial()
 o setArtificial
 public final void setArtificial(boolean artificial)
 o reserveLocal
 public boolean reserveLocal(int varIndex,
                             CodeAttr code)
Assign a local variable to a given local variable slot.

Parameters:
local - the index of the local variables.
Returns:
true iff we succeeded (i.e. the slot was unused)
 o allocateLocal
 public void allocateLocal(CodeAttr code)
Allocate slots for a local variable (or parameter).

Returns:
the index of the (first) slot.
 o freeLocal
 public void freeLocal(CodeAttr code)

All Packages  Class Hierarchy  This Package  Previous  Next  Index