Returns a string representation of graph. Encodes edge direction if graph is directed.
(Graph<?> graph)
| 355 | * is directed. |
| 356 | */ |
| 357 | public static String toString(Graph<?> graph) { |
| 358 | if (graph instanceof Network) { |
| 359 | return toString((Network<?, ?>) graph); |
| 360 | } |
| 361 | return String.format(GRAPH_FORMAT, |
| 362 | getPropertiesString(graph), |
| 363 | graph.nodes(), |
| 364 | adjacentNodesString(graph)); |
| 365 | } |
| 366 | |
| 367 | /** |
| 368 | * Returns a string representation of {@code graph}. Encodes edge direction if {@code graph} |
no test coverage detected