@Override public boolean init(Graph graph) { return !(graph.getNodeCount() == 0 || !(graph.isDirected())); }
@Override public boolean init(Graph graph) { return !(graph.getNodeCount() == 0 || !(graph.isDirected())); }
@Override public boolean init(Graph graph) { return !(graph.getNodeCount() == 0 || !(graph.isDirected())); }
public void execute(Graph graph) { isDirected = graph.isDirected(); isCanceled = false; initializeDegreeDists(); initializeAttributeColunms(graph.getModel()); graph.readLock(); try { avgWDegree = calculateAverageWeightedDegree(graph, isDirected, true); } finally { graph.readUnlockAll(); } }
public void execute(Graph graph) { isDirected = graph.isDirected(); isCanceled = false; initializeDegreeDists(); initializeAttributeColunms(graph.getModel()); graph.readLock(); try { avgDegree = calculateAverageDegree(graph, isDirected, true); graph.setAttribute(AVERAGE_DEGREE, avgDegree); } finally { graph.readUnlockAll(); } }
rankings.put(getIdStr(GraphFunction.NODE_DEGREE.getId()), new DegreeRankingImpl(graph)); if (graph.isDirected()) { if (!rankings.containsKey(getIdStr(GraphFunction.NODE_INDEGREE.getId()))) { DirectedGraph directedGraph = (DirectedGraph) graph;
@Override public Item[] getItems(Graph graph) { EdgeItem[] items = new EdgeItem[graph.getEdgeCount()]; int i = 0; for (Edge e : graph.getEdges()) { EdgeItem item = new EdgeItem(e); item.setData(EdgeItem.WEIGHT, e.getWeight(graph.getView())); item.setData(EdgeItem.DIRECTED, e.isDirected()); if (graph.isDirected(e)) { item.setData(EdgeItem.MUTUAL, ((DirectedGraph) graph).getMutualEdge(e) != null); } item.setData(EdgeItem.SELF_LOOP, e.isSelfLoop()); item.setData(EdgeItem.COLOR, e.alpha() == 0 ? null : e.getColor()); items[i++] = item; } return items; }