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

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

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

Graph.addEdge介绍

暂无

代码示例

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

@Override
public void addEdge(T src, T dst) throws IllegalArgumentException {
 delegate.addEdge(src, dst);
}

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

@Override
public void addEdge(T src, T dst) throws IllegalArgumentException {
 delegate.addEdge(src, dst);
}

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

@Override
public void addEdge(T src, T dst) throws IllegalArgumentException {
 delegate.addEdge(src, dst);
}

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

@Override
public void addEdge(int i, T src, T dst) throws IllegalArgumentException {
 delegate.addEdge(src, dst);
 SimpleVector<T> s = successorEdges.get(src);
 if (s == null) {
  s = new SimpleVector<>();
  successorEdges.put(src, s);
 }
 s.set(i, dst);
}

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

@Override
public void addEdge(int i, T src, T dst) throws IllegalArgumentException {
 delegate.addEdge(src, dst);
 SimpleVector<T> s = successorEdges.get(src);
 if (s == null) {
  s = new SimpleVector<>();
  successorEdges.put(src, s);
 }
 s.set(i, dst);
}

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

@Override
public void addEdge(int i, T src, T dst) throws IllegalArgumentException {
 delegate.addEdge(src, dst);
 SimpleVector<T> s = successorEdges.get(src);
 if (s == null) {
  s = new SimpleVector<>();
  successorEdges.put(src, s);
 }
 s.set(i, dst);
}

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

/**
 * Add this edge, unconditionally setting it as the next successor.
 */
@Override
public void addEdge(T src, T dst) throws IllegalArgumentException {
 delegate.addEdge(src, dst);
 SimpleVector<T> s = successorEdges.get(src);
 if (s == null) {
  s = new SimpleVector<>();
  successorEdges.put(src, s);
 }
 s.set(s.getMaxIndex() + 1, dst);
}

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

/**
 * Add this edge, unconditionally setting it as the next successor.
 */
@Override
public void addEdge(T src, T dst) throws IllegalArgumentException {
 delegate.addEdge(src, dst);
 SimpleVector<T> s = successorEdges.get(src);
 if (s == null) {
  s = new SimpleVector<>();
  successorEdges.put(src, s);
 }
 s.set(s.getMaxIndex() + 1, dst);
}

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

/**
 * Add this edge, unconditionally setting it as the next successor.
 */
@Override
public void addEdge(T src, T dst) throws IllegalArgumentException {
 delegate.addEdge(src, dst);
 SimpleVector<T> s = successorEdges.get(src);
 if (s == null) {
  s = new SimpleVector<>();
  successorEdges.put(src, s);
 }
 s.set(s.getMaxIndex() + 1, dst);
}

代码示例来源: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

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: Quetzal-RDF/quetzal

protected Pair<TaxoNode, TaxoNode> addEdge(T sub, T sup) {
  assert !sub.equals(sup) : sub+"\n"+sup;
  TaxoNode subN = addNode(sub);
  TaxoNode supN = addNode(sup);
  if (!lattice.hasEdge(subN, supN)) {
    lattice.addEdge(subN, supN);
  }
  return Pair.make(subN, supN);
}

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

graph.addNode(tgt_cid);
if (!graph.hasEdge(src_cid, tgt_cid)) {
  graph.addEdge(src_cid, tgt_cid);
  edges_no++;

代码示例来源: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: 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

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());

相关文章