当前位置: 首页>>代码示例>>Java>>正文


Java DirectedGraph.size方法代码示例

本文整理汇总了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;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:18,代码来源:UnreachableCodeEliminator.java

示例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);
    }
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:10,代码来源:AbstractFlowAnalysis.java

示例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;
 }
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:49,代码来源:CFGToDotGraph.java

示例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);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:9,代码来源:ForwardFlowAnalysisExtended.java

示例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);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:7,代码来源:FlowAnalysis.java


注:本文中的soot.toolkits.graph.DirectedGraph.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。