本文整理了Java中com.google.common.graph.Network.adjacentNodes()
方法的一些代码示例,展示了Network.adjacentNodes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.adjacentNodes()
方法的具体详情如下:
包路径:com.google.common.graph.Network
类名称:Network
方法名:adjacentNodes
[英]Returns the nodes which have an incident edge in common with node in this network.
[中]返回与此网络中的节点具有共同事件边缘的节点。
代码示例来源:origin: google/guava
@Override
public Set<N> adjacentNodes(N node) {
return delegate().adjacentNodes(node);
}
代码示例来源:origin: google/guava
@Override
public Set<N> adjacentNodes(N node) {
return network.adjacentNodes(node);
}
代码示例来源:origin: google/j2objc
@Override
public Set<N> adjacentNodes(N node) {
return delegate().adjacentNodes(node);
}
代码示例来源:origin: wildfly/wildfly
@Override
public Set<N> adjacentNodes(N node) {
return delegate().adjacentNodes(node);
}
代码示例来源:origin: google/guava
assertThat(network.edgesConnecting(nodeU, nodeV)).contains(edge);
assertThat(network.successors(nodeU)).contains(nodeV);
assertThat(network.adjacentNodes(nodeU)).contains(nodeV);
assertThat(network.outEdges(nodeU)).contains(edge);
assertThat(network.incidentEdges(nodeU)).contains(edge);
assertThat(network.predecessors(nodeV)).contains(nodeU);
assertThat(network.adjacentNodes(nodeV)).contains(nodeU);
assertThat(network.inEdges(nodeV)).contains(edge);
assertThat(network.incidentEdges(nodeV)).contains(edge);
assertThat(nodeString).contains(node.toString());
assertThat(network.adjacentNodes(node)).isEqualTo(asGraph.adjacentNodes(node));
assertThat(network.predecessors(node)).isEqualTo(asGraph.predecessors(node));
assertThat(network.successors(node)).isEqualTo(asGraph.successors(node));
assertThat(network.outEdges(node)).hasSize(network.outDegree(node));
} else {
assertThat(network.predecessors(node)).isEqualTo(network.adjacentNodes(node));
assertThat(network.successors(node)).isEqualTo(network.adjacentNodes(node));
assertThat(network.inEdges(node)).isEqualTo(network.incidentEdges(node));
assertThat(network.outEdges(node)).isEqualTo(network.incidentEdges(node));
for (N adjacentNode : sanityCheckSet(network.adjacentNodes(node))) {
assertTrue(
network.predecessors(node).contains(adjacentNode)
代码示例来源:origin: com.google.guava/guava-tests
@Override
public Set<N> adjacentNodes(N node) {
return network.adjacentNodes(node);
}
代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger
@Override
public Set<N> adjacentNodes(N node) {
return delegate().adjacentNodes(node);
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@Override
public Set<N> adjacentNodes(N node) {
return delegate().adjacentNodes(node);
}
代码示例来源:origin: jrtom/jung
Collection<N> neighbors = graph.adjacentNodes(currentNode);
代码示例来源:origin: jrtom/jung
public Stroke apply(N v) {
if (highlight) {
if (pi.isPicked(v)) {
return heavy;
} else {
for (N w : graph.adjacentNodes(v)) {
if (pi.isPicked(w)) {
return medium;
}
}
return light;
}
} else {
return light;
}
}
}
代码示例来源:origin: jrtom/jung
tree.addEdge(graph.incidentNodes(edge).adjacentNode(node), node, edge);
for (N adjacentNode : graph.adjacentNodes(node)) {
if (!remainingNodes.contains(adjacentNode)) {
continue;
代码示例来源:origin: jrtom/jung
node.toString() + ". with neighbors:" + vv.getModel().getNetwork().adjacentNodes(node));
代码示例来源:origin: com.google.guava/guava-tests
assertThat(network.edgesConnecting(nodeU, nodeV)).contains(edge);
assertThat(network.successors(nodeU)).contains(nodeV);
assertThat(network.adjacentNodes(nodeU)).contains(nodeV);
assertThat(network.outEdges(nodeU)).contains(edge);
assertThat(network.incidentEdges(nodeU)).contains(edge);
assertThat(network.predecessors(nodeV)).contains(nodeU);
assertThat(network.adjacentNodes(nodeV)).contains(nodeU);
assertThat(network.inEdges(nodeV)).contains(edge);
assertThat(network.incidentEdges(nodeV)).contains(edge);
assertThat(nodeString).contains(node.toString());
assertThat(network.adjacentNodes(node)).isEqualTo(asGraph.adjacentNodes(node));
assertThat(network.predecessors(node)).isEqualTo(asGraph.predecessors(node));
assertThat(network.successors(node)).isEqualTo(asGraph.successors(node));
assertThat(network.outEdges(node)).hasSize(network.outDegree(node));
} else {
assertThat(network.predecessors(node)).isEqualTo(network.adjacentNodes(node));
assertThat(network.successors(node)).isEqualTo(network.adjacentNodes(node));
assertThat(network.inEdges(node)).isEqualTo(network.incidentEdges(node));
assertThat(network.outEdges(node)).isEqualTo(network.incidentEdges(node));
for (N adjacentNode : sanityCheckSet(network.adjacentNodes(node))) {
assertTrue(
network.predecessors(node).contains(adjacentNode)
内容来源于网络,如有侵权,请联系作者删除!