soot.jimple.internal
Class JLookupSwitchStmt

java.lang.Object
  extended by soot.tagkit.AbstractHost
      extended by soot.AbstractUnit
          extended by soot.jimple.internal.AbstractStmt
              extended by soot.jimple.internal.JLookupSwitchStmt
All Implemented Interfaces:
Serializable, Context, ConvertToBaf, LookupSwitchStmt, Stmt, Host, Unit, Switchable
Direct Known Subclasses:
GLookupSwitchStmt

public class JLookupSwitchStmt
extends AbstractStmt
implements LookupSwitchStmt

See Also:
Serialized Form

Field Summary
protected  UnitBox[] targetBoxes
           
 
Fields inherited from class soot.AbstractUnit
emptyList
 
Constructor Summary
protected JLookupSwitchStmt(ValueBox keyBox, List lookupValues, UnitBox[] targetBoxes, UnitBox defaultTargetBox)
           
  JLookupSwitchStmt(Value key, List<Object> lookupValues, List<Object> targets, UnitBox defaultTarget)
          Constructs a new JLookupSwitchStmt.
  JLookupSwitchStmt(Value key, List lookupValues, List targets, Unit defaultTarget)
          Constructs a new JLookupSwitchStmt.
 
Method Summary
 void apply(Switch sw)
          Used to implement the Switchable construct.
 boolean branches()
          Returns true if execution after this statement does not necessarily continue at the following statement.
 Object clone()
          Returns a deep clone of this object.
 void convertToBaf(JimpleToBafContext context, List<Unit> out)
           
 boolean fallsThrough()
          Returns true if execution after this statement may continue at the following statement.
 Unit getDefaultTarget()
           
 UnitBox getDefaultTargetBox()
           
 Value getKey()
           
 ValueBox getKeyBox()
           
 int getLookupValue(int index)
           
 List getLookupValues()
           
 Unit getTarget(int index)
           
 UnitBox getTargetBox(int index)
           
 int getTargetCount()
           
 List getTargets()
           
 List getUnitBoxes()
          Returns a list of Boxes containing Units defined in this Unit; typically branch targets.
 List getUseBoxes()
          Returns a list of Boxes containing Values used in this Unit.
 void setDefaultTarget(Unit defaultTarget)
           
 void setKey(Value key)
           
 void setLookupValue(int index, int value)
           
 void setLookupValues(List lookupValues)
           
 void setTarget(int index, Unit target)
           
 void setTargets(Unit[] targets)
           
 String toString()
           
 void toString(UnitPrinter up)
           
 
Methods inherited from class soot.jimple.internal.AbstractStmt
containsArrayRef, containsFieldRef, containsInvokeExpr, getArrayRef, getArrayRefBox, getFieldRef, getFieldRefBox, getInvokeExpr, getInvokeExprBox
 
Methods inherited from class soot.AbstractUnit
addBoxPointingToThis, clearUnitBoxes, getBoxesPointingToThis, getDefBoxes, getUseAndDefBoxes, redirectJumpsToThisTo, removeBoxPointingToThis
 
Methods inherited from class soot.tagkit.AbstractHost
addAllTagsOf, addTag, getTag, getTags, hasTag, removeAllTags, removeTag
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface soot.jimple.Stmt
containsArrayRef, containsFieldRef, containsInvokeExpr, getArrayRef, getArrayRefBox, getFieldRef, getFieldRefBox, getInvokeExpr, getInvokeExprBox
 
Methods inherited from interface soot.Unit
addBoxPointingToThis, clearUnitBoxes, getBoxesPointingToThis, getDefBoxes, getUseAndDefBoxes, redirectJumpsToThisTo, removeBoxPointingToThis
 
Methods inherited from interface soot.tagkit.Host
addAllTagsOf, addTag, getTag, getTags, hasTag, removeAllTags, removeTag
 

Field Detail

targetBoxes

protected UnitBox[] targetBoxes
Constructor Detail

JLookupSwitchStmt

public JLookupSwitchStmt(Value key,
                         List lookupValues,
                         List targets,
                         Unit defaultTarget)
Constructs a new JLookupSwitchStmt. lookupValues should be a list of IntConst s.


JLookupSwitchStmt

public JLookupSwitchStmt(Value key,
                         List<Object> lookupValues,
                         List<Object> targets,
                         UnitBox defaultTarget)
Constructs a new JLookupSwitchStmt. lookupValues should be a list of IntConst s.


JLookupSwitchStmt

protected JLookupSwitchStmt(ValueBox keyBox,
                            List lookupValues,
                            UnitBox[] targetBoxes,
                            UnitBox defaultTargetBox)
Method Detail

clone

public Object clone()
Description copied from class: AbstractUnit
Returns a deep clone of this object.

Specified by:
clone in interface Unit
Specified by:
clone in class AbstractUnit

toString

public String toString()
Overrides:
toString in class Object

toString

public void toString(UnitPrinter up)
Specified by:
toString in interface Stmt
Specified by:
toString in interface Unit

getDefaultTarget

public Unit getDefaultTarget()
Specified by:
getDefaultTarget in interface LookupSwitchStmt

setDefaultTarget

public void setDefaultTarget(Unit defaultTarget)
Specified by:
setDefaultTarget in interface LookupSwitchStmt

getDefaultTargetBox

public UnitBox getDefaultTargetBox()
Specified by:
getDefaultTargetBox in interface LookupSwitchStmt

getKey

public Value getKey()
Specified by:
getKey in interface LookupSwitchStmt

setKey

public void setKey(Value key)
Specified by:
setKey in interface LookupSwitchStmt

getKeyBox

public ValueBox getKeyBox()
Specified by:
getKeyBox in interface LookupSwitchStmt

setLookupValues

public void setLookupValues(List lookupValues)
Specified by:
setLookupValues in interface LookupSwitchStmt

setLookupValue

public void setLookupValue(int index,
                           int value)
Specified by:
setLookupValue in interface LookupSwitchStmt

getLookupValue

public int getLookupValue(int index)
Specified by:
getLookupValue in interface LookupSwitchStmt

getLookupValues

public List getLookupValues()
Specified by:
getLookupValues in interface LookupSwitchStmt

getTargetCount

public int getTargetCount()
Specified by:
getTargetCount in interface LookupSwitchStmt

getTarget

public Unit getTarget(int index)
Specified by:
getTarget in interface LookupSwitchStmt

getTargetBox

public UnitBox getTargetBox(int index)
Specified by:
getTargetBox in interface LookupSwitchStmt

setTarget

public void setTarget(int index,
                      Unit target)
Specified by:
setTarget in interface LookupSwitchStmt

getTargets

public List getTargets()
Specified by:
getTargets in interface LookupSwitchStmt

setTargets

public void setTargets(Unit[] targets)
Specified by:
setTargets in interface LookupSwitchStmt

getUseBoxes

public List getUseBoxes()
Description copied from class: AbstractUnit
Returns a list of Boxes containing Values used in this Unit. The list of boxes is dynamically updated as the structure changes. Note that they are returned in usual evaluation order. (this is important for aggregation)

Specified by:
getUseBoxes in interface Unit
Overrides:
getUseBoxes in class AbstractUnit

getUnitBoxes

public List getUnitBoxes()
Description copied from class: AbstractUnit
Returns a list of Boxes containing Units defined in this Unit; typically branch targets. The list of boxes is dynamically updated as the structure changes.

Specified by:
getUnitBoxes in interface Unit
Overrides:
getUnitBoxes in class AbstractUnit

apply

public void apply(Switch sw)
Description copied from class: AbstractUnit
Used to implement the Switchable construct.

Specified by:
apply in interface Switchable
Overrides:
apply in class AbstractUnit

convertToBaf

public void convertToBaf(JimpleToBafContext context,
                         List<Unit> out)
Specified by:
convertToBaf in interface ConvertToBaf
Overrides:
convertToBaf in class AbstractStmt

fallsThrough

public boolean fallsThrough()
Description copied from interface: Unit
Returns true if execution after this statement may continue at the following statement. GotoStmt will return false but IfStmt will return true.

Specified by:
fallsThrough in interface Unit

branches

public boolean branches()
Description copied from interface: Unit
Returns true if execution after this statement does not necessarily continue at the following statement. GotoStmt and IfStmt will both return true.

Specified by:
branches in interface Unit