edu.uci.ics.jung.graph.Graph.getInEdges()方法的使用及代码示例

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

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

Graph.getInEdges介绍

[英]Returns a Collection view of the incoming edges incident to vertex in this graph.
[中]返回此图中与vertex关联的传入边的Collection视图。

代码示例

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Graph#getInEdges(java.lang.Object)
 */
@Override
public Collection<E> getInEdges(V vertex) {
  return delegate.getInEdges(vertex);
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Graph#getInEdges(java.lang.Object)
 */
public Collection<E> getInEdges(V vertex) {
  return delegate.getInEdges(vertex);
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Graph#getInEdges(java.lang.Object)
 */
public synchronized Collection<E> getInEdges(V vertex) {
  return delegate.getInEdges(vertex);
}

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Graph#getInEdges(java.lang.Object)
 */
@Override
public synchronized Collection<E> getInEdges(V vertex) {
  return delegate.getInEdges(vertex);
}

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Graph#getInEdges(java.lang.Object)
 */
@Override
public Collection<E> getInEdges(V vertex) {
  return delegate.getInEdges(vertex);
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Graph#getInEdges(java.lang.Object)
 */
public Collection<E> getInEdges(V vertex) {
  return delegate.getInEdges(vertex);
}

代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer

/**
 * Returns the incoming edges of the vertex.
 * @param vertex The vertx
 * @return The collection of edges.
 */
public Collection getInEdges(Object vertex)
{
  return delegate.getInEdges(vertex);
}

代码示例来源:origin: net.sf.jung/jung-visualization

public Collection<E> getInEdges(V vertex) {
  return graph.getInEdges(vertex);
}
public int getNeighborCount(V vertex) {

代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app

private Set<V> getRoots() {
  Set<V> roots = graph.getVertices().stream()
      .filter(v -> graph.getInEdges(v).isEmpty())
      // Preserve the order of the roots
      .collect(Collectors.toCollection(LinkedHashSet::new));
  return roots;
}

代码示例来源:origin: geogebra/geogebra

@Override
public E getParentEdge(V vertex) {
  if (isRoot(vertex)) {
    return null;
  }
  return delegate.getInEdges(vertex).iterator().next();
}

代码示例来源:origin: OpenNMS/opennms

private Set<V> getRoots() {
  Set<V> roots = graph.getVertices().stream()
      .filter(v -> graph.getInEdges(v).isEmpty())
      // Preserve the order of the roots
      .collect(Collectors.toCollection(LinkedHashSet::new));
  return roots;
}

代码示例来源:origin: net.sf.jung/jung-graph-impl

public E getParentEdge(V vertex)
{
  if (isRoot(vertex))
    return null;
  return delegate.getInEdges(vertex).iterator().next();
}

代码示例来源:origin: citiususc/hipster

@Override
  public Iterable<GraphEdge<V, E>> incomingEdgesOf(V vertex) {
    try {
      // getInEdges blueprints impl throws null pointer exception
      final Collection<E> inEdges = graph.getInEdges(vertex);
      if (inEdges == null || inEdges.isEmpty()) {
        return Collections.emptyList();
      }
      return adapt(inEdges);
    }catch(NullPointerException e){
      return Collections.emptyList();
    }
  }
}

代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2

protected V findRoot(Graph<V,E> graph) {
  for(V v : graph.getVertices()) {
    if(graph.getInEdges(v).size() == 0) {
      return v;
    }
  }
  // if there is no obvious root, pick any vertex
  if(graph.getVertexCount() > 0) {
    return graph.getVertices().iterator().next();
  }
  // this graph has no vertices
  return null;
}

代码示例来源:origin: geogebra/geogebra

protected V findRoot(Graph<V, E> graph) {
  for (V v : graph.getVertices()) {
    if (graph.getInEdges(v).size() == 0) {
      return v;
    }
  }
  // if there is no obvious root, pick any vertex
  if (graph.getVertexCount() > 0) {
    return graph.getVertices().iterator().next();
  }
  // this graph has no vertices
  return null;
}

代码示例来源:origin: net.sf.jung/jung-algorithms

protected V findRoot(Graph<V,E> graph) {
  for(V v : graph.getVertices()) {
    if(graph.getInEdges(v).size() == 0) {
      return v;
    }
  }
  // if there is no obvious root, pick any vertex
  if(graph.getVertexCount() > 0) {
    return graph.getVertices().iterator().next();
  }
  // this graph has no vertices
  return null;
}

代码示例来源:origin: net.sourceforge.jadex/jadex-rules-tools

/**
   *  Calculate the edge lengths between a node and its parents/children.
   */
  protected double	calcEdgeLengths(Graph graph, INode node, int layer, int pos)
  {
    double	length	= 0;
    
    for(Iterator it=graph.getInEdges(node).iterator(); it.hasNext(); )
    {
      ReteEdge    edge    = (ReteEdge)it.next();
//            System.out.println(edge);
      length += calcEdgeLength(edge, node, layer, pos);
    }
    
    for(Iterator it=graph.getOutEdges(node).iterator(); it.hasNext(); )
    {
      ReteEdge    edge    = (ReteEdge)it.next();
//            System.out.println(edge);
      length += calcEdgeLength(edge, node, layer, pos);
    }
    
    return length;
  }

代码示例来源:origin: net.sf.jung/jung-algorithms

protected void updateRankings() {

    for (V v : getVertices()) {

      Collection<E> incomingEdges = getGraph().getInEdges(v);

      double currentPageRankSum = 0;
      for (E e : incomingEdges) {
        double currentWeight = getEdgeWeight(e);
        currentPageRankSum += 
          mPreviousRankingsMap.get(getGraph().getOpposite(v,e)).doubleValue()*currentWeight;
      }
      setCurrentRankScore(v,currentPageRankSum);
    }
  }
}

代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2

protected void updateRankings() {

    for (V v : getVertices()) {

      Collection<E> incomingEdges = getGraph().getInEdges(v);

      double currentPageRankSum = 0;
      for (E e : incomingEdges) {
        double currentWeight = getEdgeWeight(e);
        currentPageRankSum += 
          mPreviousRankingsMap.get(getGraph().getOpposite(v,e)).doubleValue()*currentWeight;
      }
      setCurrentRankScore(v,currentPageRankSum);
    }
  }
}

代码示例来源:origin: girtel/Net2Plan

public int getIndex(Graph<GUINode,GUILink> graph, GUILink e) 
  {
    final GUINode u = e.getOriginNode();
    final GUINode v = e.getDestinationNode();
    final HashSet<GUILink> commonEdgeSet = new HashSet<>(graph.getInEdges(v));
    commonEdgeSet.retainAll(graph.getOutEdges(u));
    commonEdgeSet.removeIf(ee->!ee.isShownSeparated());
    int count=0;
    for(GUILink other : commonEdgeSet) 
      if (other == e)
        return count;
      else
        count ++;
    throw new RuntimeException();
  }
});

相关文章