Jode 1.90-CVS
Build Aug 6, 2004

net.sf.jode.decompiler
Class LocalInfo

java.lang.Object
  extended bynet.sf.jode.decompiler.LocalInfo
All Implemented Interfaces:
Declarable

public class LocalInfo
extends java.lang.Object
implements Declarable

The LocalInfo represents a local variable of a method. The problem is that two different local variables may use the same slot. The current strategie is to make the range of a local variable as small as possible.

There may be more than one LocalInfo for a single local variable, because the algorithm begins with totally disjunct variables and then unifies locals. One of the local is then a shadow object which calls the member functions of the other local.


Constructor Summary
LocalInfo()
          Create a new local info with an anonymous slot.
LocalInfo(MethodAnalyzer method, int slot)
          Create a new local info.
 
Method Summary
 void addHint(java.lang.String name, Type type)
           
 void combineWith(LocalInfo shadow)
          Combines the LocalInfo with another.
 void dumpDeclaration(TabbedPrintWriter writer)
           
 boolean equals(java.lang.Object obj)
           
 Expression getExpression()
           
 LocalInfo getLocalInfo()
          Get the real LocalInfo.
 MethodAnalyzer getMethodAnalyzer()
           
 java.lang.String getName()
          Get the name of this local.
 int getSlot()
          Get the slot of this local.
 Type getType()
          Get the type of this local.
 int getUseCount()
           
 java.lang.String guessName()
           
 boolean hasName()
          Returns true if the local already has a name.
static void init()
           
 boolean isConstant()
           
 boolean isFinal()
           
 boolean isNameGenerated()
           
 boolean isRemoved()
           
 boolean isShadow()
           
 void makeNameUnique()
          Set the name of this local.
 boolean markFinal()
           
 void remove()
           
 void setExpression(Expression expr)
           
 void setName(java.lang.String name)
          Set the name of this local.
 void setOperator(LocalVarOperator operator)
           
 Type setType(Type otherType)
          Sets a new information about the type of this local.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalInfo

public LocalInfo()
Create a new local info with an anonymous slot.


LocalInfo

public LocalInfo(MethodAnalyzer method,
                 int slot)
Create a new local info.

Parameters:
slot - The slot of this variable.
Method Detail

init

public static void init()

setOperator

public void setOperator(LocalVarOperator operator)

addHint

public void addHint(java.lang.String name,
                    Type type)

getUseCount

public int getUseCount()

combineWith

public void combineWith(LocalInfo shadow)
Combines the LocalInfo with another. This will make this a shadow object to the other local info. That is all member functions will use the new local info instead of data in this object.

If this is called with ourself nothing will happen.


getLocalInfo

public LocalInfo getLocalInfo()
Get the real LocalInfo. This may be different from the current object if this is a shadow local info.


hasName

public boolean hasName()
Returns true if the local already has a name.


guessName

public java.lang.String guessName()

getName

public java.lang.String getName()
Get the name of this local.

Specified by:
getName in interface Declarable

isNameGenerated

public boolean isNameGenerated()

getSlot

public int getSlot()
Get the slot of this local.


setName

public void setName(java.lang.String name)
Set the name of this local.


makeNameUnique

public void makeNameUnique()
Set the name of this local.

Specified by:
makeNameUnique in interface Declarable

getType

public Type getType()
Get the type of this local.


setType

public Type setType(Type otherType)
Sets a new information about the type of this local. The type of the local is may be made more specific by this call.

Returns:
The new type of the local.

setExpression

public void setExpression(Expression expr)

getExpression

public Expression getExpression()

isShadow

public boolean isShadow()

equals

public boolean equals(java.lang.Object obj)

remove

public void remove()

isRemoved

public boolean isRemoved()

isConstant

public boolean isConstant()

getMethodAnalyzer

public MethodAnalyzer getMethodAnalyzer()

markFinal

public boolean markFinal()

isFinal

public boolean isFinal()

toString

public java.lang.String toString()

dumpDeclaration

public void dumpDeclaration(TabbedPrintWriter writer)
                     throws java.io.IOException
Specified by:
dumpDeclaration in interface Declarable
Throws:
java.io.IOException

Jode 1.90-CVS
Build Aug 6, 2004

Copyright © 1998-2004 by Jochen Hoenicke.