Returns a {@link NetworkBuilder} initialized with all properties queryable from {@code network}. <p>The "queryable" properties are those that are exposed through the {@link Network} interface, such as {@link Network#isDirected()}. Other properties, such as {@link #expectedNodeCount(int)}, are not s
(Network<N, E> network)
| 100 | * #expectedNodeCount(int)}, are not set in the new builder. |
| 101 | */ |
| 102 | public static <N, E> NetworkBuilder<N, E> from(Network<N, E> network) { |
| 103 | return new NetworkBuilder<N, E>(network.isDirected()) |
| 104 | .allowsParallelEdges(network.allowsParallelEdges()) |
| 105 | .allowsSelfLoops(network.allowsSelfLoops()) |
| 106 | .nodeOrder(network.nodeOrder()) |
| 107 | .edgeOrder(network.edgeOrder()); |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Returns an {@link ImmutableNetwork.Builder} with the properties of this {@link NetworkBuilder}. |