org.ow2.asmdex.structureCommon
Class LocalVariable

java.lang.Object
  extended by org.ow2.asmdex.structureCommon.LocalVariable

public class LocalVariable
extends java.lang.Object

A Local Variable. It is identified by its Register Number. It can hold none or one Starts, and none, one or or several Ends and/or Restart Labels. The Start may be unknown. In that case, the name, type and signature are also unknown, as they are given along with the Start in the debug_info_item.

Author:
Julien Névo

Constructor Summary
LocalVariable(int register)
          Constructor of the Local Variable.
LocalVariable(int register, java.lang.String name, java.lang.String type, java.lang.String signature, Label start, java.util.List<Label> ends, java.util.List<Label> restarts)
          Constructor of the Local Variable.
 
Method Summary
 void addEnd(Label end)
          Adds the Label where the variable ends.
 void addRestart(Label restart)
          Adds the Label where the variable restarts.
 java.util.List<Label> getEnds()
          Returns the Labels where the variable ends.
 java.lang.String getName()
          Returns the name of the variable.
 int getRegister()
          Returns the register index of the variable.
 java.util.List<Label> getRestarts()
          Returns the Labels where the variable restarts.
 java.lang.String getSignature()
          Returns the signature.
 Label getStart()
          Returns the Label where the variable starts.
 java.lang.String getType()
          Returns the type (descriptor) of the variable.
 void setName(java.lang.String name)
          Sets the name of the variable.
 void setSignature(java.lang.String signature)
          Sets the signature of the variable.
 void setStart(Label start)
          Sets the Start of the variable.
 void setType(java.lang.String type)
          Sets the type of the variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalVariable

public LocalVariable(int register,
                     java.lang.String name,
                     java.lang.String type,
                     java.lang.String signature,
                     Label start,
                     java.util.List<Label> ends,
                     java.util.List<Label> restarts)
Constructor of the Local Variable.

Parameters:
register - the register index of the variable.
name - the name of the variable.
type - the type (descriptor) of the variable.
signature - the signature. Only used by generics, Null otherwise.
start - the Label where the variable starts.
ends - the Labels where the variable ends. May be null.
restarts - the Labels where the variable restarts. May be null.

LocalVariable

public LocalVariable(int register)
Constructor of the Local Variable.

Parameters:
register - the register index of the variable.
Method Detail

getRegister

public int getRegister()
Returns the register index of the variable.

Returns:
the register index of the variable.

getName

public java.lang.String getName()
Returns the name of the variable.

Returns:
the name of the variable.

setName

public void setName(java.lang.String name)
Sets the name of the variable.

Parameters:
name - the name of the variable.

getType

public java.lang.String getType()
Returns the type (descriptor) of the variable.

Returns:
the type (descriptor) of the variable.

setType

public void setType(java.lang.String type)
Sets the type of the variable.

Parameters:
type - the type of the variable.

getSignature

public java.lang.String getSignature()
Returns the signature. Only used by generics, Null otherwise.

Returns:
the signature. Only used by generics, Null otherwise.

setSignature

public void setSignature(java.lang.String signature)
Sets the signature of the variable.

Parameters:
signature - the signature of the variable.

getStart

public Label getStart()
Returns the Label where the variable starts.

Returns:
the Label where the variable starts.

setStart

public void setStart(Label start)
Sets the Start of the variable.

Parameters:
start - the Start of the variable.

getEnds

public java.util.List<Label> getEnds()
Returns the Labels where the variable ends. May be null.

Returns:
the Labels where the variable ends. May be null.

getRestarts

public java.util.List<Label> getRestarts()
Returns the Labels where the variable restarts. May be null.

Returns:
the Labels where the variable restarts. May be null.

addEnd

public void addEnd(Label end)
Adds the Label where the variable ends.

Parameters:
end - the Label where the variable ends.

addRestart

public void addRestart(Label restart)
Adds the Label where the variable restarts.

Parameters:
restart - the Label where the variable restarts.