|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsoot.toolkits.graph.Block
public class 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. |
List<Block> |
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. |
List<Block> |
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. |
Iterator<Unit> |
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. |
void |
setIndexInMethod(int aIndexInMethod)
Set the index of this Block in the list of Blocks that partition its enclosing Body instance. |
void |
setPreds(List<Block> preds)
Sets the list of Blocks that are predecessors of this block in it's enclosing BlockGraph instance. |
void |
setSuccs(List<Block> succs)
Sets the list of Blocks that are successors of this block in it's enclosing BlockGraph instance. |
String |
toShortString()
|
String |
toString()
|
| 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,
Bodypublic Iterator<Unit> 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.Unitpublic 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 void setIndexInMethod(int aIndexInMethod)
aIndexInMethod - The index of this Block in the list of
Blocks that partition it's enclosing
Body instance.public int getIndexInMethod()
public Unit getHead()
public Unit getTail()
public void setPreds(List<Block> preds)
preds - The a List of Blocks that precede this block.BlockGraphpublic List<Block> getPreds()
BlockGraphpublic void setSuccs(List<Block> succs)
succs - The a List of Blocks that succede this block.BlockGraphpublic List<Block> getSuccs()
BlockGraphpublic String toShortString()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||