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

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

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

Graph.getNumberOfNodes介绍

暂无

代码示例

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

@Override
public int getNumberOfNodes() {
 return delegate.getNumberOfNodes();
}

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

@Override
public int getNumberOfNodes() {
 return delegate.getNumberOfNodes();
}

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

@Override
public int getNumberOfNodes() {
 return delegate.getNumberOfNodes();
}

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

@Override
public int getNumberOfNodes() {
 return delegate.getNumberOfNodes();
}

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

@Override
public int getNumberOfNodes() {
 return delegate.getNumberOfNodes();
}

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

@Override
public int getNumberOfNodes() {
 return delegate.getNumberOfNodes();
}

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

/**
 * @param G The graph
 * @param root The root from which to compute dominators
 * @throws IllegalArgumentException if G is null
 */
@SuppressWarnings("unchecked")
public Dominators(Graph<T> G, T root) throws IllegalArgumentException {
 if (G == null) {
  throw new IllegalArgumentException("G is null");
 }
 this.G = G;
 this.root = root;
 if (G.getNumberOfNodes() == 0) {
  throw new IllegalArgumentException("G has no nodes");
 }
 this.vertex = (T[]) new Object[G.getNumberOfNodes() + 1];
}

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

/**
 * @param G The graph
 * @param root The root from which to compute dominators
 * @throws IllegalArgumentException if G is null
 */
@SuppressWarnings("unchecked")
public Dominators(Graph<T> G, T root) throws IllegalArgumentException {
 if (G == null) {
  throw new IllegalArgumentException("G is null");
 }
 this.G = G;
 this.root = root;
 if (G.getNumberOfNodes() == 0) {
  throw new IllegalArgumentException("G has no nodes");
 }
 this.vertex = (T[]) new Object[G.getNumberOfNodes() + 1];
}

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

/**
 * @param G The graph
 * @param root The root from which to compute dominators
 * @throws IllegalArgumentException if G is null
 */
@SuppressWarnings("unchecked")
public Dominators(Graph<T> G, T root) throws IllegalArgumentException {
 if (G == null) {
  throw new IllegalArgumentException("G is null");
 }
 this.G = G;
 this.root = root;
 if (G.getNumberOfNodes() == 0) {
  throw new IllegalArgumentException("G has no nodes");
 }
 this.vertex = (T[]) new Object[G.getNumberOfNodes() + 1];
}

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

private Graph<ConstructId> readFromDisk(String _file) {
  try {
    try (final ObjectInputStream ois = new ObjectInputStream(new FileInputStream(_file))) {
      final Object object = ois.readObject();
      @SuppressWarnings("unchecked") final Graph<ConstructId> g = (Graph<ConstructId>) object;
      log.info("Read call graph with [" + g.getNumberOfNodes() + "] nodes from [" + _file + "]");
      return g;
    }
  } catch (IOException ioe) {
    log.error("I/O error when reading object from [" + _file + "]: " + ioe.getMessage(), ioe);
  } catch (ClassNotFoundException cnfe) {
    log.error("Class not found when reading object from [" + _file + "]: " + cnfe.getMessage(), cnfe);
  }
  return null;
}

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

private void writeToDisk(String _file, Graph<ConstructId> _g) {
  try {
    // Create all parent dirs
    final Path p = Paths.get(_file);
    FileUtil.createDirectory(p.getParent());
    // Write object
    final File f = new File(_file);
    try (final ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(f))) {
      oos.writeObject(_g);
      log.info("Wrote call graph with [" + _g.getNumberOfNodes() + "] nodes to [" + _file + "]");
    }
  } catch (IOException ioe) {
    log.error("I/O error when writing object to [" + _file + "]: " + ioe.getMessage(), ioe);
  }
}

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

private void init(Graph<T> G, Iterator<? extends T> nodes) {
 this.G = G;
 if (G.getNumberOfNodes() == 0) {
  return;
 }
 while (nodes.hasNext()) {
  T o = nodes.next();
  if (visited.add(o)) {
   Q.add(o);
  }
 }
 index = 0;
 if (Q.size() > 0) {
  T current = Q.get(0);
  visitChildren(current);
 }
}

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

private void init(Graph<T> G, Iterator<? extends T> nodes) {
 this.G = G;
 if (G.getNumberOfNodes() == 0) {
  return;
 }
 while (nodes.hasNext()) {
  T o = nodes.next();
  if (visited.add(o)) {
   Q.add(o);
  }
 }
 index = 0;
 if (Q.size() > 0) {
  T current = Q.get(0);
  visitChildren(current);
 }
}

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

private void init(Graph<T> G, Iterator<? extends T> nodes) {
 this.G = G;
 if (G.getNumberOfNodes() == 0) {
  return;
 }
 while (nodes.hasNext()) {
  T o = nodes.next();
  if (visited.add(o)) {
   Q.add(o);
  }
 }
 index = 0;
 if (Q.size() > 0) {
  T current = Q.get(0);
  visitChildren(current);
 }
}

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

public GenericDominators(Graph<T> G, T root)
  throws IllegalArgumentException 
{
 super(G, root);
 this.infoMap = HashMapFactory.make(G.getNumberOfNodes());
 analyze();
}

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

public GenericDominators(Graph<T> G, T root)
  throws IllegalArgumentException 
{
 super(G, root);
 this.infoMap = HashMapFactory.make(G.getNumberOfNodes());
 analyze();
}

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

public GenericDominators(Graph<T> G, T root)
  throws IllegalArgumentException 
{
 super(G, root);
 this.infoMap = HashMapFactory.make(G.getNumberOfNodes());
 analyze();
}

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

/**
 * check that g is a well-formed graph, and that it contains exactly the number of nodes in the slice
 */
private static void sanityCheck(Collection<Statement> slice, Graph<Statement> g) {
 try {
  GraphIntegrity.check(g);
 } catch (UnsoundGraphException e1) {
  e1.printStackTrace();
  Assertions.UNREACHABLE();
 }
 Assertions.productionAssertion(g.getNumberOfNodes() == slice.size(), "panic " + g.getNumberOfNodes() + " " + slice.size());
}

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

@Ignore("works for me on Eclipse Luna, but I cannot make it work with maven")
@Test
public void testParsing() throws IOException, CoreException {
 Set<ModuleEntry> mes = JsdtUtil.getJavaScriptCodeFromProject(project.projectName);
 CGInfo info = JsdtUtil.buildJSDTCallGraph(mes);
 
 System.err.println(info.calls.size());
 System.err.println("call graph:\n" + info.cg);
 Assert.assertTrue("cannot find any function calls", info.calls.size()>0);
 Assert.assertTrue("cannot find any cg nodes", info.cg.getNumberOfNodes()>0);
}

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

int n5 = 0;
try {
 n1 = G.getNumberOfNodes();
 n2 = 0;
 for (T t : G) {

相关文章