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

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

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

Graph.getSuccessors介绍

[英]Returns a Collection view of the successors of vertex in this graph. A successor of vertex is defined as a vertex v which is connected to vertex by an edge e, where e is an incoming edge of v and an outgoing edge of vertex.
[中]返回此图中vertex的继承者的Collection视图。vertex的后续项定义为一个顶点v,该顶点通过一条边e连接到vertex,其中ev的传入边和vertex的传出边。

代码示例

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

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

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

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

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

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

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

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

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

/**
 * Returns the vertices that have an incoming edge from the given vertex.
 * @param vertex The vertex.
 * @return The collection of vertices.
 */
public Collection getSuccessors(Object vertex)
{
  return delegate.getSuccessors(vertex);
}

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

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

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

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

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

/**
 * Returns the children of {@code v}.
 */
@Override
public Collection<V> getChildren(V v) {
  return delegate.getSuccessors(v);
}

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

/**
 * @param v the vertex whose children are to be returned
 * @return the children of {@code v}.
 */
public Collection<V> getChildren(V v) {
  return delegate.getSuccessors(v);
}

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

public Collection<V> getSuccessors(V vertex) {
  return graph.getSuccessors(vertex);
}
public int getVertexCount() {

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

private int calculateDimensionX(V v) {
  int size = 0;
  int childrenNum = graph.getSuccessors(v).size();
  if (childrenNum != 0) {
    for (V element : graph.getSuccessors(v)) {
      size += calculateDimensionX(element) + distX;
    }
  }
  size = Math.max(0, size - distX);
  basePositions.put(v, size);
  return size;
}

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

private int calculateDimensionX(V v) {
  int size = 0;
  int childrenNum = graph.getSuccessors(v).size();
  if (childrenNum != 0) {
    for (V element : graph.getSuccessors(v)) {
      size += calculateDimensionX(element) + distX;
    }
  }
  size = Math.max(0, size - distX);
  basePositions.put(v, size);
  return size;
}

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

/**
 * get the immediate children nodes of the passed parent
 */
@Override
public Collection<V> getChildren(V parent) {
  if (!delegate.containsVertex(parent)) {
    return null;
  }
  return delegate.getSuccessors(parent);
}

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

/**
 * get the immediate children nodes of the passed parent
 */
public Collection<V> getChildren(V parent) {
  if (!delegate.containsVertex(parent))
    return null;
  return delegate.getSuccessors(parent);
}

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

/**
 * Returns the set of nodes reachable from a given node.
 *
 * @param node Node
 * @return Collection of reachable nodes
 */
public Collection<Node> getNeighbors(Node node)
{
  return Collections.unmodifiableCollection(getGraph_JUNG().getSuccessors(node));
}

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

private void buildTree(V v, int x) {
  if (!alreadyDone.contains(v)) {
    alreadyDone.add(v);
    //go one level further down
    this.m_currentPoint.y = (levelMap.get(v) + 1) * this.distY;
    this.m_currentPoint.x = x;
    this.setCurrentPositionFor(v);
    int sizeXofCurrent = basePositions.get(v);
    int lastX = x - sizeXofCurrent / 2;
    int sizeXofChild;
    int startXofChild;
    for (V element : graph.getSuccessors(v)) {
      sizeXofChild = this.basePositions.get(element);
      startXofChild = lastX + sizeXofChild / 2;
      buildTree(element, startXofChild);
      lastX = lastX + sizeXofChild + distX;
    }
    this.m_currentPoint.y -= this.distY;
  }
}

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

private void buildTree(V v, int x) {
  if (!alreadyDone.contains(v)) {
    alreadyDone.add(v);
    //go one level further down
    this.m_currentPoint.y = (levelMap.get(v) + 1) * this.distY;
    this.m_currentPoint.x = x;
    this.setCurrentPositionFor(v);
    int sizeXofCurrent = basePositions.get(v);
    int lastX = x - sizeXofCurrent / 2;
    int sizeXofChild;
    int startXofChild;
    for (V element : graph.getSuccessors(v)) {
      sizeXofChild = this.basePositions.get(element);
      startXofChild = lastX + sizeXofChild / 2;
      buildTree(element, startXofChild);
      lastX = lastX + sizeXofChild + distX;
    }
    this.m_currentPoint.y -= this.distY;
  }
}

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

/**
 * setRoot calculates the level of each vertex in the graph. Level 0 is
 * allocated to any vertex with no successors. Level n+1 is allocated to
 * any vertex whose successors' maximum level is n.
 */
public void setRoot(Graph<V,E> g) {
  numRoots = 0;
  for(V v : g.getVertices()) {
    Collection<V> successors = getGraph().getSuccessors(v);
    if (successors.size() == 0) {
      setRoot(v);
      numRoots++;
    }
  }
}

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

/**
 * Calculates the level of each vertex in the graph. Level 0 is
 * allocated to each vertex with no successors. Level n+1 is allocated to
 * any vertex whose successors' maximum level is n.
 */
public void setRoot() {
  numRoots = 0;
  Graph<V, E> g = getGraph();
  for(V v : g.getVertices()) {
    if (g.getSuccessors(v).isEmpty()) {
      setRoot(v);
      numRoots++;
    }
  }
}

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

/**
 * Removes <code>vertex</code> from this tree. If
 * <code>remove_subtrees</code> is <code>true</code>, removes the subtrees
 * rooted at the children of <code>vertex</code>. Otherwise, leaves these
 * subtrees intact as new component trees of this forest.
 * 
 * @param vertex
 *            the vertex to remove
 * @param remove_subtrees
 *            if <code>true</code>, remove the subtrees rooted at
 *            <code>vertex</code>'s children
 * @return <code>true</code> iff the tree was modified
 */
public boolean removeVertex(V vertex, boolean remove_subtrees) {
  if (!delegate.containsVertex(vertex)) {
    return false;
  }
  if (remove_subtrees) {
    for (V v : new ArrayList<V>(delegate.getSuccessors(vertex))) {
      removeVertex(v, true);
    }
  }
  return delegate.removeVertex(vertex);
}

相关文章