本文整理汇总了Java中soot.toolkits.graph.DirectedGraph.size方法的典型用法代码示例。如果您正苦于以下问题:Java DirectedGraph.size方法的具体用法?Java DirectedGraph.size怎么用?Java DirectedGraph.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类soot.toolkits.graph.DirectedGraph
的用法示例。
在下文中一共展示了DirectedGraph.size方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reachable
import soot.toolkits.graph.DirectedGraph; //导入方法依赖的package包/类
private <T> Set<T> reachable(T first, DirectedGraph<T> g) {
if ( first == null || g == null ) {
return Collections.<T>emptySet();
}
Set<T> visited = new HashSet<T>(g.size());
Deque<T> q = new ArrayDeque<T>();
q.addFirst(first);
do {
T t = q.removeFirst();
if ( visited.add(t) ) {
q.addAll(g.getSuccsOf(t));
}
}
while (!q.isEmpty());
return visited;
}
示例2: AbstractFlowAnalysis
import soot.toolkits.graph.DirectedGraph; //导入方法依赖的package包/类
/** Constructs a flow analysis on the given <code>DirectedGraph</code>. */
public AbstractFlowAnalysis(DirectedGraph<N> graph)
{
unitToBeforeFlow = new IdentityHashMap<N,A>(graph.size() * 2 + 1);
this.graph = graph;
if (Options.v().interactive_mode()){
InteractionHandler.v().handleCfgEvent(graph);
}
}
示例3: drawCFG
import soot.toolkits.graph.DirectedGraph; //导入方法依赖的package包/类
/**
* Create a <code>DotGraph</code> whose nodes and edges depict
* a control flow graph without distinguished
* exceptional edges.
*
* @param graph a <code>DirectedGraph</code> representing a CFG
* (probably an instance of {@link UnitGraph}, {@link BlockGraph},
* or one of their subclasses).
*
* @param body the <code>Body</code> represented by <code>graph</code> (used
* to format the text within nodes). If no body is available, pass
* <code>null</code>.
*
* @return a visualization of <code>graph</code>.
*/
public <N> DotGraph drawCFG(DirectedGraph<N> graph, Body body) {
DotGraph canvas = initDotGraph(body);
DotNamer<N> namer = new DotNamer<N>((int)(graph.size()/0.7f), 0.7f);
NodeComparator<N> comparator = new NodeComparator<N>(namer);
// To facilitate comparisons between different graphs of the same
// method, prelabel the nodes in the order they appear
// in the iterator, rather than the order that they appear in the
// graph traversal (so that corresponding nodes are more likely
// to have the same label in different graphs of a given method).
for (Iterator<N> nodesIt = graph.iterator(); nodesIt.hasNext(); ) {
namer.getName(nodesIt.next());
}
for (Iterator<N> nodesIt = graph.iterator(); nodesIt.hasNext(); ) {
N node = nodesIt.next();
canvas.drawNode(namer.getName(node));
for (Iterator<N> succsIt = sortedIterator(graph.getSuccsOf(node), comparator);
succsIt.hasNext(); ) {
N succ = succsIt.next();
canvas.drawEdge(namer.getName(node), namer.getName(succ));
}
}
setStyle(graph.getHeads(), canvas, namer,
DotGraphConstants.NODE_STYLE_FILLED, headAttr);
setStyle(graph.getTails(), canvas, namer,
DotGraphConstants.NODE_STYLE_FILLED, tailAttr);
if (! isBrief) {
formatNodeText(body, canvas, namer);
}
return canvas;
}
示例4: ForwardFlowAnalysisExtended
import soot.toolkits.graph.DirectedGraph; //导入方法依赖的package包/类
/**
* Construct the analysis from a DirectedGraph representation of a Body.
*/
public ForwardFlowAnalysisExtended(DirectedGraph<N> graph) {
this.graph = graph;
this.unitToBeforeFlow = new IdentityHashMap<N,Map<N, A>>(graph.size() * 2 + 1);
this.unitToAfterFlow = new IdentityHashMap<N, Map<N, A>>(graph.size() * 2 + 1);
}
示例5: FlowAnalysis
import soot.toolkits.graph.DirectedGraph; //导入方法依赖的package包/类
/** Constructs a flow analysis on the given <code>DirectedGraph</code>. */
public FlowAnalysis(DirectedGraph<N> graph) {
super(graph);
unitToAfterFlow = new IdentityHashMap<N, A>(graph.size() * 2 + 1);
}