soot
Class AbstractUnitBox

java.lang.Object
  extended by soot.AbstractUnitBox
All Implemented Interfaces:
Serializable, UnitBox
Direct Known Subclasses:
StmtBox

public abstract class AbstractUnitBox
extends Object
implements UnitBox

Reference implementation for UnitBox; just add a canContainUnit method.

See Also:
Serialized Form

Field Summary
protected  Unit unit
           
 
Constructor Summary
AbstractUnitBox()
           
 
Method Summary
abstract  boolean canContainUnit(Unit u)
          Returns true if this box can contain the given Unit.
 Unit getUnit()
          Returns the unit contained within this box.
 boolean isBranchTarget()
          Returns true if the UnitBox is holding a Unit that is the target of a branch (ie a Unit at the beginning of a CFG block).
 void setUnit(Unit unit)
          Sets this box to contain the given unit.
 void toString(UnitPrinter up)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unit

protected Unit unit
Constructor Detail

AbstractUnitBox

public AbstractUnitBox()
Method Detail

canContainUnit

public abstract boolean canContainUnit(Unit u)
Description copied from interface: UnitBox
Returns true if this box can contain the given Unit.

Specified by:
canContainUnit in interface UnitBox

isBranchTarget

public boolean isBranchTarget()
Description copied from interface: UnitBox
Returns true if the UnitBox is holding a Unit that is the target of a branch (ie a Unit at the beginning of a CFG block). This is the default case.

Returns false if the UnitBox is holding a Unit that indicates the end of a CFG block and may require specialised processing for SSA.

Specified by:
isBranchTarget in interface UnitBox

setUnit

public void setUnit(Unit unit)
Description copied from interface: UnitBox
Sets this box to contain the given unit. Subject to canContainValue() checks.

Specified by:
setUnit in interface UnitBox

getUnit

public Unit getUnit()
Description copied from interface: UnitBox
Returns the unit contained within this box.

Specified by:
getUnit in interface UnitBox

toString

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