com.ibm.wala.util.graph.Graph.addNode()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中com.ibm.wala.util.graph.Graph.addNode()方法的一些代码示例,展示了Graph.addNode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.addNode()方法的具体详情如下:
包路径:com.ibm.wala.util.graph.Graph
类名称:Graph
方法名:addNode

Graph.addNode介绍

暂无

代码示例

代码示例来源:origin: wala/WALA

@Override
public void addNode(T n) {
 delegate.addNode(n);
}

代码示例来源:origin: wala/WALA

@Override
public void addNode(T n) {
 delegate.addNode(n);
}

代码示例来源:origin: wala/WALA

@Override
public void addNode(T n) {
 delegate.addNode(n);
}

代码示例来源:origin: com.ibm.wala/com.ibm.wala.util

@Override
public void addNode(T n) {
 delegate.addNode(n);
}

代码示例来源:origin: wala/WALA

@Override
public void addNode(T n) {
 delegate.addNode(n);
}

代码示例来源:origin: com.ibm.wala/com.ibm.wala.util

@Override
public void addNode(T n) {
 delegate.addNode(n);
}

代码示例来源:origin: Quetzal-RDF/quetzal

protected TaxoNode addNode(T elt) {
  TaxoNode ret =elt2Node.get(elt);
  if (ret==null) {
    ret = new TaxoNode(elt);
    elt2Node.put(elt, ret);
    lattice.addNode(ret);
  }
  return ret;
}

代码示例来源:origin: wala/WALA

public static <T> void copyInto(Graph<T> g, Graph<T> into) {
 if (g == null) {
  throw new IllegalArgumentException("g is null");
 }
 for (T name : g) {
  into.addNode(name);
 }
 for (T n : g) {
  for (T succ : Iterator2Iterable.make(g.getSuccNodes(n))) {
   into.addEdge(n, succ);
  }
 }
}

代码示例来源:origin: wala/WALA

public static <T> void copyInto(Graph<T> g, Graph<T> into) {
 if (g == null) {
  throw new IllegalArgumentException("g is null");
 }
 for (T name : g) {
  into.addNode(name);
 }
 for (T n : g) {
  for (T succ : Iterator2Iterable.make(g.getSuccNodes(n))) {
   into.addEdge(n, succ);
  }
 }
}

代码示例来源:origin: com.ibm.wala/com.ibm.wala.util

public static <T> void copyInto(Graph<T> g, Graph<T> into) {
 if (g == null) {
  throw new IllegalArgumentException("g is null");
 }
 for (T name : g) {
  into.addNode(name);
 }
 for (T n : g) {
  for (T succ : Iterator2Iterable.make(g.getSuccNodes(n))) {
   into.addEdge(n, succ);
  }
 }
}

代码示例来源:origin: SAP/vulnerability-assessment-tool

this.nodeInfoMap.put(src_id, this.createNodeMetaInformation(src_node, src_id));
this.nodeId.add(src_node);
this.idgraph.addNode(src_id);
  this.nodeInfoMap.put(tgt_id, this.createNodeMetaInformation(tgt_node, tgt_id));
  this.nodeId.add(tgt_node);
  this.idgraph.addNode(tgt_id);

代码示例来源:origin: wala/WALA

private static Graph<String> createGraph(String edges) {
 Graph<String> g = SlowSparseNumberedGraph.make();
 for(int i = 0; i < edges.length(); i+= 2) {
  String from = edges.substring(i, i+1);
  if (! g.containsNode(from)) {
   g.addNode(from);
  }
  
  String to = edges.substring(i+1, i+2);
  if (! g.containsNode(to)) {
   g.addNode(to);
  }
  
  g.addEdge(from, to);
 }
 return g;
}

代码示例来源:origin: SAP/vulnerability-assessment-tool

srcnode = nodes.next();
src_cid = getCid(srcnode.getMethod());
graph.addNode(src_cid);
  tgtnode = succNodes.next();
  tgt_cid = getCid(tgtnode.getMethod());
  graph.addNode(tgt_cid);
  if (!graph.hasEdge(src_cid, tgt_cid)) {
    graph.addEdge(src_cid, tgt_cid);

代码示例来源:origin: wala/WALA

deleted.addNode(ch);
deleted.addNode(cfg.exit());
deleted.addEdge(ch, cfg.exit());

代码示例来源:origin: com.ibm.wala/com.ibm.wala.core

deleted.addNode(ch);
deleted.addNode(cfg.exit());
deleted.addEdge(ch, cfg.exit());

代码示例来源:origin: Quetzal-RDF/quetzal

public PlanNode join(JoinTypes type, Query query, Graph<PlanNode> plan, PlanNode lhs, PlanNode rhs, Set<Variable> liveVars) {
  plan.addNode(rhs);
  if (lhs == null) {
    return rhs;
    plan.addNode(and);
    plan.addEdge(and, lhs);
    plan.addEdge(and, rhs);

代码示例来源:origin: wala/WALA

/**
 * @return a graph with the expected structure
 */
public static Graph<String> buildGraph() {
 Graph<String> G = SlowSparseNumberedGraph.make();
 for (int i = 0; i < nodeNames.length(); i++) {
  String n = nodeNames.substring(i, i + 1);
  G.addNode(n);
  nodes[i] = n;
 }
 G.addEdge(nodes[0], nodes[1]);
 G.addEdge(nodes[1], nodes[2]);
 G.addEdge(nodes[1], nodes[3]);
 G.addEdge(nodes[2], nodes[4]);
 G.addEdge(nodes[3], nodes[4]);
 G.addEdge(nodes[4], nodes[5]);
 return G;
}

代码示例来源:origin: wala/WALA

/**
 * Return a view of an {@link IClassHierarchy} as a {@link Graph}, with edges from classes to immediate subtypes
 */
public static Graph<IClass> typeHierarchy2Graph(IClassHierarchy cha) {
 Graph<IClass> result = SlowSparseNumberedGraph.make();
 for (IClass c : cha) {
  result.addNode(c);
 }
 for (IClass c : cha) {
  for (IClass x : cha.getImmediateSubclasses(c)) {
   result.addEdge(c, x);
  }
  if (c.isInterface()) {
   for (IClass x : cha.getImplementors(c.getReference())) {
    result.addEdge(c, x);
   }
  }
 }
 return result;
}

代码示例来源:origin: wala/WALA

/**
  * Return a view of an {@link IClassHierarchy} as a {@link Graph}, with edges from classes to immediate subtypes
  */
 public static Graph<IClass> typeHierarchy2Graph(IClassHierarchy cha) {
  Graph<IClass> result = SlowSparseNumberedGraph.make();
  for (IClass c : cha) {
   result.addNode(c);
  }
  for (IClass c : cha) {
   for (IClass x : cha.getImmediateSubclasses(c)) {
    result.addEdge(c, x);
   }
   if (c.isInterface()) {
    for (IClass x : cha.getImplementors(c.getReference())) {
     result.addEdge(c, x);
    }
   }
  }
  return result;
 }  
}

代码示例来源:origin: wala/WALA

G.addNode(nodes[i] = Integer.valueOf(i));

相关文章