soot
Class AbstractUnit

java.lang.Object
  |
  +--soot.tagkit.AbstractHost
        |
        +--soot.AbstractUnit
Direct Known Subclasses:
AbstractInst, AbstractStmt, ASTNode

public abstract class AbstractUnit
extends AbstractHost
implements Unit

Provides default implementations for the methods in Unit.

See Also:
Serialized Form

Field Summary
static java.util.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  java.lang.Object clone()
          Returns a deep clone of this object.
 java.util.List getBoxesPointingToThis()
          Returns a list of Boxes pointing to this Unit.
 java.util.List getDefBoxes()
          Returns a list of Boxes containing Values defined in this Unit.
 java.util.List getUnitBoxes()
          Returns a list of Boxes containing Units defined in this Unit; typically branch targets.
 java.util.List getUseAndDefBoxes()
          Returns a list of ValueBoxes, either used or defined in this Unit.
 java.util.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
 

Field Detail

emptyList

public static final java.util.List emptyList
Canonical AbstractUnit.emptyList list.
Constructor Detail

AbstractUnit

public AbstractUnit()
Method Detail

clone

public abstract java.lang.Object clone()
Returns a deep clone of this object.
Specified by:
clone in interface Unit
Overrides:
clone in class java.lang.Object

getUseBoxes

public java.util.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 java.util.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 java.util.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 java.util.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 java.util.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.

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
Tags copied from interface: Unit
See Also:
PatchingChain.getNonPatchingChain(), Shimple.redirectToPreds(Chain, Unit), Shimple.redirectPointers(Unit, Unit)