calculates the number of edges in the graph Note: this is an expensive operation, because edges are stored as part of the nodes
()
| 271 | * Note: this is an expensive operation, because edges are stored as part of the nodes |
| 272 | */ |
| 273 | public int edgeCount() { |
| 274 | int edgeCount = 0; |
| 275 | final Iterator<Node> nodes = nodes(); |
| 276 | while (nodes.hasNext()) { |
| 277 | NodeDb node = getNodeDb(nodes.next()); |
| 278 | edgeCount += node.outEdgeCount(); |
| 279 | } |
| 280 | return edgeCount; |
| 281 | } |
| 282 | |
| 283 | /** number of edges grouped by label */ |
| 284 | public Map<String, Integer> edgeCountByLabel() { |