soot
Class AbstractUnit

java.lang.Object
  extended by soot.tagkit.AbstractHost
      extended by soot.AbstractUnit
All Implemented Interfaces:
Serializable, Context, Host, Unit, Switchable
Direct Known Subclasses:
AbstractInst, AbstractStmt, ASTNode, DVariableDeclarationStmt

public abstract class AbstractUnit
extends AbstractHost
implements Unit

Provides default implementations for the methods in Unit.

See Also:
Serialized Form

Field Summary
static List emptyList
          Canonical AbstractUnit.emptyList list.
 
Constructor Summary
AbstractUnit()
           
 
Method Summary
 void addBoxPointingToThis(UnitBox b)
          Adds a box to the list returned by getBoxesPointingToThis.
 void apply(Switch sw)
          Used to implement the Switchable construct.
 void clearUnitBoxes()
          Clears any pointers to and from this Unit's UnitBoxes.
abstract  Object clone()
          Returns a deep clone of this object.
 List getBoxesPointingToThis()
          Returns a list of Boxes pointing to this Unit.
 List getDefBoxes()
          Returns a list of Boxes containing Values defined in this Unit.
 List getUnitBoxes()
          Returns a list of Boxes containing Units defined in this Unit; typically branch targets.
 List getUseAndDefBoxes()
          Returns a list of ValueBoxes, either used or defined in this Unit.
 List getUseBoxes()
          Returns a list of Boxes containing Values used in this Unit.
 void redirectJumpsToThisTo(Unit newLocation)
          Redirects jumps to this Unit to newLocation.
 void removeBoxPointingToThis(UnitBox b)
          Removes a box from the list returned by getBoxesPointingToThis.
 
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, toString, wait, wait, wait
 
Methods inherited from interface soot.Unit
branches, fallsThrough, toString
 
Methods inherited from interface soot.tagkit.Host
addAllTagsOf, addTag, getTag, getTags, hasTag, removeAllTags, removeTag
 

Field Detail

emptyList

public static final List emptyList
Canonical AbstractUnit.emptyList list.

Constructor Detail

AbstractUnit

public AbstractUnit()
Method Detail

clone

public abstract Object clone()
Returns a deep clone of this object.

Specified by:
clone in interface Unit
Overrides:
clone in class Object

getUseBoxes

public List getUseBoxes()
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

getDefBoxes

public List getDefBoxes()
Returns a list of Boxes containing Values defined in this Unit. The list of boxes is dynamically updated as the structure changes.

Specified by:
getDefBoxes in interface Unit

getUnitBoxes

public List getUnitBoxes()
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

getBoxesPointingToThis

public List getBoxesPointingToThis()
Returns a list of Boxes pointing to this Unit.

Specified by:
getBoxesPointingToThis in interface Unit

addBoxPointingToThis

public void addBoxPointingToThis(UnitBox b)
Description copied from interface: Unit
Adds a box to the list returned by getBoxesPointingToThis.

Specified by:
addBoxPointingToThis in interface Unit

removeBoxPointingToThis

public void removeBoxPointingToThis(UnitBox b)
Description copied from interface: Unit
Removes a box from the list returned by getBoxesPointingToThis.

Specified by:
removeBoxPointingToThis in interface Unit

clearUnitBoxes

public void clearUnitBoxes()
Description copied from interface: Unit
Clears any pointers to and from this Unit's UnitBoxes.

Specified by:
clearUnitBoxes in interface Unit

getUseAndDefBoxes

public List getUseAndDefBoxes()
Returns a list of ValueBoxes, either used or defined in this Unit.

Specified by:
getUseAndDefBoxes in interface Unit

apply

public void apply(Switch sw)
Used to implement the Switchable construct.

Specified by:
apply in interface Switchable

redirectJumpsToThisTo

public void redirectJumpsToThisTo(Unit newLocation)
Description copied from interface: Unit
Redirects jumps to this Unit to newLocation. In general, you shouldn't have to use this directly.

Specified by:
redirectJumpsToThisTo in interface Unit
See Also:
PatchingChain.getNonPatchingChain(), soot.shimple.Shimple#redirectToPreds(Chain, Unit), Shimple.redirectPointers(Unit, Unit)