本文整理汇总了Java中org.graphstream.graph.Edge.getNode0方法的典型用法代码示例。如果您正苦于以下问题:Java Edge.getNode0方法的具体用法?Java Edge.getNode0怎么用?Java Edge.getNode0使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.graphstream.graph.Edge
的用法示例。
在下文中一共展示了Edge.getNode0方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unlabelAdjacentEdges
import org.graphstream.graph.Edge; //导入方法依赖的package包/类
/**
* unlabels all edges connected to node which are no longer
* connected to any other labeled node
* @param n - the node to apply to adjacent edges
*/
private void unlabelAdjacentEdges(Node n)
{
for (Edge e : n.getEdgeSet()){
Node v1 = e.getNode0();
Node v2 = e.getNode1();
String ui_label_v1 = v1.getAttribute("ui.label");
String ui_label_v2 = v2.getAttribute("ui.label");
if ((ui_label_v1==null || ui_label_v1.equals(""))
&& (ui_label_v2==null || ui_label_v2.equals("")))
{
e.setAttribute("ui.label", "");
}
}
}
示例2: getCuttingEdgesCount
import org.graphstream.graph.Edge; //导入方法依赖的package包/类
public Integer getCuttingEdgesCount(Graph gr) {
Integer cuttingEdges = 0;
Collection<Edge> edges = gr.getEdgeSet();
for (Edge edge : edges) {
Node n0 = edge.getNode0();
Node n1 = edge.getNode1();
if (n0.hasAttribute(GraphPartitionator.PARTITION_ATTRIBUTE) &&
n1.hasAttribute(GraphPartitionator.PARTITION_ATTRIBUTE)) {
if (!n0.getAttribute(GraphPartitionator.PARTITION_ATTRIBUTE).equals(
n1.getAttribute(GraphPartitionator.PARTITION_ATTRIBUTE))) {
cuttingEdges++;
}
}
}
return cuttingEdges;
}