|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--soot.toolkits.graph.Block
Represents BasicBlocks that partition a method body. It is implemented as view on an underlying Body instance; as a consequence, changes made on a Block will be automatically reflected in its enclosing method body. Blocks also exist in the context of a BlockGraph, a CFG for a method where Block instances are the nodes of the graph. Hence, a Block can be queried for its successors and predecessors Blocks, as found in this graph.
Constructor Summary | |
Block(Unit aHead,
Unit aTail,
Body aBody,
int aIndexInMethod,
int aBlockLength,
BlockGraph aBlockGraph)
Constructs a Block in the context of a BlockGraph, and enclosing Body instances. |
Method Summary | |
Body |
getBody()
Returns the Block's enclosing Body instance. |
Unit |
getHead()
Returns the first unit in this block. |
int |
getIndexInMethod()
Returns the index of this Block in the list of Blocks that partition it's enclosing Body instance. |
Unit |
getPredOf(Unit aItem)
Returns the Unit occuring immediatly before some other Unit in the block. |
java.util.List |
getPreds()
Returns the List of Block that are predecessors to this block, |
Unit |
getSuccOf(Unit aItem)
Returns the Unit occuring immediatly after some other Unit in the block. |
java.util.List |
getSuccs()
Returns the List of Blocks that are successors to this block, |
Unit |
getTail()
Returns the last unit in this block. |
void |
insertAfter(Unit toInsert,
Unit point)
Inserts a Unit after some other Unit in the Block. |
void |
insertBefore(Unit toInsert,
Unit point)
Inserts a Unit before some other Unit in this block. |
java.util.Iterator |
iterator()
Returns an iterator for the linear chain of Units that make up the block. |
boolean |
remove(Unit item)
Removes a Unit occuring before some other Unit in the Block. |
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 |
toShortString()
|
java.lang.String |
toString()
|
protected java.lang.String |
toString(boolean isBrief,
java.util.Map stmtToName,
java.lang.String indentation)
|
java.lang.String |
toString(java.util.Map stmtToName)
|
java.lang.String |
toString(java.util.Map stmtToName,
java.lang.String indentation)
|
java.lang.String |
toString(java.lang.String indentation)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Block(Unit aHead, Unit aTail, Body aBody, int aIndexInMethod, int aBlockLength, BlockGraph aBlockGraph)
aHead
- The first unit ir this Block.aTail
- The last unit in this Block.aBody
- The Block's enclosing Body instance.aIndexInMethod
- The index of this Block in the list of
Blocks that partition it's enclosing Body instance.aBlockLength
- The number of units that makeup this block.aBlockGraph
- The Graph of Blocks in which this block lives.Body
,
Chain
,
BlockGraph
,
Unit
,
SootMethod
Method Detail |
public Body getBody()
JimpleBody
,
BafBody
,
Body
public java.util.Iterator iterator()
Chain
,
Unit
public void insertBefore(Unit toInsert, Unit point)
toInsert
- A Unit to be inserted.point
- A Unit in the Block's body
before which we wish to insert the Unit.Unit
,
Chain
public void insertAfter(Unit toInsert, Unit point)
toInsert
- A Unit to be inserted.point
- A Unit in the Block after which we wish to
insert the Unit.Unit
public boolean remove(Unit item)
item
- A Unit to be remove from the Block's Unit Chain.public Unit getSuccOf(Unit aItem)
aItem
- The Unit from which we wish to get it's successor.aItem
is the tail
for this Block.public Unit getPredOf(Unit aItem)
aItem
- The Unit from which we wish to get it's predecessor.aItem
is the head
for this Block.public int getIndexInMethod()
public Unit getHead()
public Unit getTail()
public java.util.List getPreds()
BlockGraph
public java.util.List getSuccs()
BlockGraph
public java.lang.String toShortString()
public java.lang.String toBriefString()
public java.lang.String toBriefString(java.util.Map stmtToName)
public java.lang.String toBriefString(java.lang.String indentation)
public java.lang.String toBriefString(java.util.Map stmtToName, java.lang.String indentation)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.util.Map stmtToName)
public java.lang.String toString(java.lang.String indentation)
public java.lang.String toString(java.util.Map stmtToName, java.lang.String indentation)
protected java.lang.String toString(boolean isBrief, java.util.Map stmtToName, java.lang.String indentation)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |