soot
Class AbstractUnit

java.lang.Object
  |
  +--soot.tagkit.AbstractHost
        |
        +--soot.AbstractUnit
All Implemented Interfaces:
Host, Switchable, Unit
Direct Known Subclasses:
AbstractInst, AbstractStmt

public abstract class AbstractUnit
extends AbstractHost
implements Unit

Provides default implementations for the methods in Unit.


Field Summary
static java.util.List emptyList
          Canonical AbstractUnit.emptyList list.
 
Constructor Summary
AbstractUnit()
           
 
Method Summary
 void apply(Switch sw)
          Used to implement the Switchable construct.
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)
          Adjusts UnitBoxes pointing to this Unit to a newLocation.
 java.lang.String toBriefString()
          Returns a brief description of this object.
 java.lang.String toBriefString(java.util.Map stmtToName)
          Returns a brief description of this object, using the given Map.
 java.lang.String toBriefString(java.util.Map stmtToName, java.lang.String indentation)
          Returns a brief description of this object, using the given Map and indentation.
 java.lang.String toBriefString(java.lang.String indentation)
          Returns a brief description of this object, using the given indentation.
 java.lang.String toString()
          Returns a textual representation of this object.
protected abstract  java.lang.String toString(boolean isBrief, java.util.Map stmtToName, java.lang.String indentation)
          Returns a textual representation of this object, with the given briefness, Map and indentation.
 java.lang.String toString(java.util.Map stmtToName)
          Returns a textual representation of this object, using the given Map.
 java.lang.String toString(java.util.Map stmtToName, java.lang.String indentation)
          Returns a textual representation of this object, using the given Map and indentation.
 java.lang.String toString(java.lang.String indentation)
          Returns a textual representation of this object, using the given indentation.
 
Methods inherited from class soot.tagkit.AbstractHost
addTag, getTag, getTags, hasTag, removeTag
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface soot.Unit
branches, fallsThrough
 
Methods inherited from interface soot.tagkit.Host
addTag, getTag, getTags, hasTag, removeTag
 

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

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.
Specified by:
apply in interface Switchable

toBriefString

public java.lang.String toBriefString()
Returns a brief description of this object.
Specified by:
toBriefString in interface Unit

toBriefString

public java.lang.String toBriefString(java.util.Map stmtToName)
Returns a brief description of this object, using the given Map.

toBriefString

public java.lang.String toBriefString(java.lang.String indentation)
Returns a brief description of this object, using the given indentation.

toBriefString

public java.lang.String toBriefString(java.util.Map stmtToName,
                                      java.lang.String indentation)
Returns a brief description of this object, using the given Map and indentation.
Specified by:
toBriefString in interface Unit

toString

public java.lang.String toString()
Returns a textual representation of this object.
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.util.Map stmtToName)
Returns a textual representation of this object, using the given Map.

toString

public java.lang.String toString(java.lang.String indentation)
Returns a textual representation of this object, using the given indentation.

toString

public java.lang.String toString(java.util.Map stmtToName,
                                 java.lang.String indentation)
Returns a textual representation of this object, using the given Map and indentation.
Specified by:
toString in interface Unit

toString

protected abstract java.lang.String toString(boolean isBrief,
                                             java.util.Map stmtToName,
                                             java.lang.String indentation)
Returns a textual representation of this object, with the given briefness, Map and indentation.

redirectJumpsToThisTo

public void redirectJumpsToThisTo(Unit newLocation)
Adjusts UnitBoxes pointing to this Unit to a newLocation.
Specified by:
redirectJumpsToThisTo in interface Unit